OnWindowFocusChanged() публичный Метод

called whenever the window focus changes
public OnWindowFocusChanged ( bool hasFocus ) : void
hasFocus bool whether the window now has focus
Результат void
Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {            
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);
            //create a new dialog
            dialog = CustomProgressDialog.CreateDialog(this);
            dialog.OnWindowFocusChanged(true);
                        
            Button btnGO = FindViewById<Button>(Resource.Id.go);
            btnGO.Click += (s,e) => 
            {
                int result = 0;
                //show the dialog
                dialog.Show();
                //do some things
                Task task = new Task(() =>
                {
                    for (int i = 0; i < 100; i++)
                    {
                        result += i;
                    }
                });
                task.ContinueWith(t =>
                {
                    Intent intent = new Intent(this, typeof(LastActivity));
                    intent.PutExtra("name", result.ToString());  
                    StartActivity(intent);
                });
                task.Start();                                
            };           
        }