public MainActivityViewModel(Activity context)
        {
            this.NavigateReactivePropertyBasicsCommand = new ReactiveCommand();
            this.NavigateReactivePropertyBasicsCommand
                .Subscribe(_ => context.StartActivity(typeof(ReactivePropertyBasicsActivity)));

            this.NavigateListAdapterCommand = new ReactiveCommand();
            this.NavigateListAdapterCommand
                .Subscribe(_ => context.StartActivity(typeof(ListAdapterActivity)));
        }
		public static void Start (Activity activity, bool edit, ActivityOptions options)
		{
			var starter = new Intent (activity, typeof(SignInActivity));
			starter.PutExtra (ExtraEdit, edit);
			if (options == null) {
				activity.StartActivity (starter);
				activity.OverridePendingTransition (Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight);
			} else {
				activity.StartActivity (starter, options.ToBundle ());
			}
		}
		/// <summary>
		/// 启动登录活动activity.并传入参数至下一步
		/// </summary>
		/// <param name="activity">Activity.</param>
		public static void StartTargetActivity(Activity activity,FuncActivityType _funcActivityType)
		{
			var type = FuncTypeActivityFactory.CreateFuncActivityFactory ((int)_funcActivityType);
			if (HasLogin) {
				//已经登录
				activity.StartActivity(type);
				activity.OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			} else {
				//未登录,跳转到登录界面
				Intent intent = new Intent (activity, typeof(LoginActivity));
				intent.PutExtra (Global.FuncType, (int)_funcActivityType);
				activity.StartActivity (intent);
				activity.OverridePendingTransition (Resource.Animation.bottom_in, 0);
			}
		}
        public ActivityRoutedViewHost(Activity hostActivity)
        {
            var keyUp = hostActivity.GetType()
                .GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.Instance)
                .FirstOrDefault(x => x.Name == "OnKeyUp");

            if (keyUp == null) {
                throw new Exception("You must override OnKeyUp and call theRoutedViewHost.OnKeyUp");
            }

            var viewFor = hostActivity as IViewFor;
            if (viewFor == null) {
                throw new Exception("You must implement IViewFor<TheViewModelClass>");
            }

            bool firstSet = false;
            _inner = _hostScreen.Router.ViewModelObservable()
                .Where(x => x != null)
                .Subscribe(vm => {
                    if (!firstSet) {
                        viewFor.ViewModel = vm;
                        firstSet = true;
                        return;
                    }

                    var view = RxRouting.ResolveView(vm);
                    if (view.GetType() != typeof(Type)) {
                        throw new Exception("Views in Android must be the Type of an Activity");
                    }

                    hostActivity.StartActivity((Type)view);
                });
        }
Exemple #5
0
        /// <summary>
        /// Presents the necessary UI for the user to sign in to their account.
        /// </summary>
        /// <returns>
        /// A task for when authentication has completed.
        /// </returns>
        public virtual Task <IEnumerable <Account> > GetAccountsWithAuthUIAsync(UIContext context)
        {
            var tcs = new TaskCompletionSource <IEnumerable <Account> > ();

            var authenticator = GetEmbeddedAuthenticator();

            if (authenticator == null)
            {
                throw new NotSupportedException("This service does not support authentication via a controller.");
            }

            authenticator.Error += (sender, e) => {
                tcs.TrySetException(e.Exception ?? new SocialException(e.Message));
            };

            authenticator.Completed += (sender, e) => {
                if (e.IsAuthenticated)
                {
                    SaveAccount(e.Account, context);
                    tcs.TrySetResult(new [] { e.Account });
                }
                else
                {
                    tcs.TrySetCanceled();
                }
            };

            var authenticatorUi = authenticator.GetUI(context);

            context.StartActivity(authenticatorUi);

            return(tcs.Task);
        }
		void StartQuizActivityWithTransition(Activity activity, View toolbar, Category category) {
			var pairs = TransitionHelper.CreateSafeTransitionParticipants(activity, false, new Pair(toolbar, activity.GetString(Resource.String.transition_toolbar)));
			var sceneTransitionAnimation = ActivityOptions.MakeSceneTransitionAnimation(activity, pairs);

			// Start the activity with the participants, animating from one to the other.
			var transitionBundle = sceneTransitionAnimation.ToBundle();
			activity.StartActivity(QuizActivity.GetStartIntent(activity, category), transitionBundle);
		}
        public void Show(Activity activity)
        {
            Validate();

            var i = FillIntent();
            activity.StartActivity(i);
            activity.OverridePendingTransition(AnimationEnterInResource, AnimationEnterOutResource);
        }
        protected void OpenUriSimple(Android.App.Activity activity, Uri uri)
        {
            Intent intent = new Intent(Intent.ActionView);

            intent.SetData(uri);
            activity.StartActivity(intent);

            return;
        }
        protected void OpenUriXamarinAuthWebViewActivity(Android.App.Activity activity, Uri uri)
        {
            Intent intent = new Intent(activity, typeof(Xamarin.Auth.WebViewActivity));

            intent.PutExtra(Xamarin.Auth.WebViewActivity.EXTRA_URL, uri.ToString());
            activity.StartActivity(intent);

            return;
        }
        private void Login(Xamarin.Auth.XamarinForms.Helpers.OAuth1 oauth1)
        {
            global::Xamarin.Auth.OAuth1Authenticator auth =
                new global::Xamarin.Auth.OAuth1Authenticator
                (
                    consumerKey: oauth1.OAuth_IdApplication_IdAPI_KeyAPI_IdClient_IdCustomer,
                    consumerSecret: oauth1.OAuth1_SecretKey_ConsumerSecret_APISecret,
                    requestTokenUrl: oauth1.OAuth1_UriRequestToken,
                    authorizeUrl: oauth1.OAuth_UriAuthorization,
                    accessTokenUrl: oauth1.OAuth1_UriAccessToken,
                    callbackUrl: oauth1.OAuth_UriCallbackAKARedirect,
                    getUsernameAsync: null
                );

            auth.Completed += auth_Completed;

            activity.StartActivity(auth.GetUI(activity));

            return;
        }
Exemple #11
0
        public static bool switchByIdFromList(int id, Android.App.Activity activity)
        {
            switch (id)
            {
            case 2:
                activity.StartActivity((typeof(PlaylistsActivity)));
                return(true);

            case 3:
                activity.StartActivity((typeof(ArtistsActivity)));
                return(true);

            case 4:
                activity.StartActivity((typeof(GenresPageActivity)));
                return(true);

            case 6:
                activity.StartActivity(typeof(AccountActivity));
                return(true);

            case 7:
                activity.StartActivity(typeof(PasswordChangeActivity));
                return(true);

            case 8:
                switchSavedUser(null);
                activity.StartActivity(typeof(LoginActivity));
                activity.Finish();
                return(true);

            default:
                return(false);
            }
        }
Exemple #12
0
        public static void ShowDonateReminderIfAppropriate(Activity context)
        {
            foreach (Reminder r in GetReminders())
            {
                if ((DateTime.Now >= r.From )
                    && (DateTime.Now < r.To))
                {
                    ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(context);
                    if (prefs.GetBoolean(r.Key, false) == false)
                    {
                        ISharedPreferencesEditor edit = prefs.Edit();
                        edit.PutBoolean(r.Key, true);
                        EditorCompat.Apply(edit);

                        context.StartActivity(new Intent(context, typeof(DonateReminder)));
                    }
                }
            }
        }
        public MainActivityViewModel(Activity context, AppContext app)
        {
            this.People = app.Master.People.ToReadOnlyReactiveCollection(x => new PersonViewModel(x));

            this.InsertNewCommand = new ReactiveCommand();
            this.InsertNewCommand.Subscribe(_ => app.Master.InsertNew());

            this.LoadCommand = new ReactiveCommand();
            this.LoadCommand.Subscribe(_ => app.Master.Load());

            this.LoadMoreCommand = app.Master.ObserveProperty(x => x.CanLoadMore)
                .ToReactiveCommand();
            this.LoadMoreCommand.Subscribe(_ => app.Master.LoadMore());

            this.EditCommand = new ReactiveCommand<long>();
            this.EditCommand.Subscribe(id =>
                {
                    app.Detail.SetEditTarget(id);
                    context.StartActivity(typeof(DetailActivity));
                });
        }
        public ActivityRoutedViewHost(Activity hostActivity, IViewLocator viewLocator = null)
        {
            viewLocator = viewLocator ?? ViewLocator.Current;
            var platform = RxApp.DependencyResolver.GetService<IPlatformOperations>();

            var keyUp = hostActivity.GetType()
                .GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.NonPublic | BindingFlags.Instance)
                .FirstOrDefault(x => x.Name == "OnKeyUp");

            if (keyUp == null) {
                throw new Exception("You must override OnKeyUp and call theRoutedViewHost.OnKeyUp");
            }

            var viewFor = hostActivity as IViewFor;
            if (viewFor == null) {
                throw new Exception("You must implement IViewFor<TheViewModelClass>");
            }

            bool firstSet = false;

            _inner = _hostScreen.Router.CurrentViewModel
                .Where(x => x != null)
                .Subscribe(vm => {
                    if (!firstSet) {
                        viewFor.ViewModel = vm;
                        firstSet = true;
                        return;
                    }

                    var view = viewLocator.ResolveView(vm, platform.GetOrientation());
                    if (view.GetType() != typeof(Type)) {
                        throw new Exception("Views in Android must be the Type of an Activity");
                    }
                    
                    hostActivity.StartActivity((Type)view);
                });
        }
        public bool OpenAppSettings()
        {
            if (_Activity == null)
            {
                return(false);
            }

            try
            {
                var settingsIntent = new Intent();
                settingsIntent.SetAction(Android.Provider.Settings.ActionApplicationDetailsSettings);
                settingsIntent.AddCategory(Intent.CategoryDefault);
                settingsIntent.SetData(Android.Net.Uri.Parse("package:" + _Activity.PackageName));
                settingsIntent.AddFlags(ActivityFlags.NewTask);
                settingsIntent.AddFlags(ActivityFlags.NoHistory);
                settingsIntent.AddFlags(ActivityFlags.ExcludeFromRecents);
                _Activity.StartActivity(settingsIntent);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
 public static void startThisActivity(Activity activity)
 {
     activity.StartActivity(new Intent(activity, typeof(Sample2Activity)));
 }
 private void OpenLinkInBrowser(string url, Activity activity)
 {
     string link = url
             .Replace(BrokerConstants.BrowserExtPrefix, "https://");
     Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(link));
     activity.StartActivity(intent);
 }
Exemple #18
0
        public static void Launch(Activity act, PwEntry pw, int pos, AppTask appTask, ActivityFlags? flags = null)
        {
            Intent i = new Intent(act, typeof(EntryActivity));

            i.PutExtra(KeyEntry, pw.Uuid.ToHexString());
            i.PutExtra(KeyRefreshPos, pos);

            if (flags != null)
                i.SetFlags((ActivityFlags) flags);

            appTask.ToIntent(i);
            if (flags != null && (((ActivityFlags) flags) | ActivityFlags.ForwardResult) == ActivityFlags.ForwardResult)
                act.StartActivity(i);
            else
                act.StartActivityForResult(i, 0);
        }
Exemple #19
0
        public static void Launch(Activity act, IOConnectionInfo ioc, AppTask appTask)
        {
            if (ioc.IsLocalFile())
            {
                Launch(act, ioc.Path, appTask);
                return;
            }

            Intent i = new Intent(act, typeof(PasswordActivity));

            PutIoConnectionToIntent(ioc, i);
            i.SetFlags(ActivityFlags.ForwardResult);

            appTask.ToIntent(i);

            act.StartActivity(i);
        }
 private void StartActivity(Activity sourceActivity, Type activityType)
 {
     var intent = new Intent(sourceActivity, activityType);
     intent.PutExtra("sourceActivity", sourceActivity.GetType().FullName);
     sourceActivity.StartActivity(intent);
 }
Exemple #21
0
 /// <summary>
 /// Start new activity
 /// </summary>
 /// <param name="currentActivity">current activity</param>
 /// <param name="newActivityType">new activity to start</param>
 public static void StartNewActivity(Activity currentActivity, Type newActivityType)
 {
     var intent = new Intent(currentActivity, newActivityType);
     currentActivity.StartActivity(intent);
 }
Exemple #22
0
 public static void Logout(Activity activity)
 {
     Csla.ApplicationContext.User = new Csla.Security.UnauthenticatedPrincipal();
     activity.StartActivity(typeof(Welcome));
 }
 public static void Start(Activity activity)
 {
     Intent intent = new Intent(activity, typeof(MainActivity));
     activity.StartActivity(intent);
     activity.OverridePendingTransition(Resource.Animation.activity_fade_enter, Resource.Animation.activity_fade_exit);
 }
Exemple #24
0
        //--------------------------------------------------------------
        // METHODS
        //--------------------------------------------------------------
        /* Activate the bluetooth to allow connection with an other device*/
        public ResultEnabling TryEnablingBluetooth(Activity activity)
        {
            #if DEBUG
            Log.Debug(Tag, "TryEnablingBluetooth()");
            #endif

            // Get local Bluetooth adapter
            BluetoothAdapter bluetoothAdapter = BluetoothAdapter.DefaultAdapter;

            // If the adapter is null, then Bluetooth is not supported
            if(bluetoothAdapter == null)
            {
                #if DEBUG
                Log.Debug(Tag, "display of the alert");
                #endif

                UtilsDialog.PopUpEndEvent += activity.Finish;
                Intent intent = UtilsDialog.CreateBluetoothDialogNoCancel(activity, Resource.String.BTNotAvailable);
                activity.StartActivity(intent);
                return ResultEnabling.NoMedium;
            }

            // If the bluetooth is not enable, we try to activate it
            if(!bluetoothAdapter.IsEnabled)
            {
                #if DEBUG
                Log.Debug(Tag, "intent to activate bluetooth");
                #endif

                Intent enableIntent = new Intent(BluetoothAdapter.ActionRequestEnable);
                activity.StartActivityForResult(enableIntent,(int) Utils.RequestCode.RequestEnableBluetooth);
                return ResultEnabling.Activation;
            }

            #if DEBUG
            Log.Debug(Tag, "creation of BluetoothManager");
            #endif

            EnableBluetooth();
            _communicationWay.Start();
            return ResultEnabling.Enabled;
        }
Exemple #25
0
 public bool ResultBluetoothActivation(int requestCode, Result resultCode, Activity activity)
 {
     if(requestCode == (int) Utils.RequestCode.RequestEnableBluetooth)
     {
         // When the request to enable Bluetooth returns
         if(resultCode == Result.Ok)
         {
             // Bluetooth is now enabled
             EnableBluetooth();
             CommunicationWay.Start();
             return Enabled;
         }
         else
         {
             // User did not enable Bluetooth or an error occured
             #if DEBUG
             Log.Debug(Tag, "Bluetooth not enabled");
             #endif
             UtilsDialog.PopUpEndEvent += activity.Finish;
             Intent intent = UtilsDialog.CreateBluetoothDialogNoCancel(activity, Resource.String.BTNotEnabled);
             activity.StartActivity(intent);
         }
     }
     return false;
 }
Exemple #26
0
        internal void LaunchApp(Activity ctx, ParseUser withUser, Action uiCallback)
        {
            // Fetch the person corresponding to the user
            Task.Factory.StartNew (() => {
                var query = new ParseQuery ("Person");
                query.SetCachePolicy (ParseQuery.CachePolicy.CacheElseNetwork);
                query.WhereEqualTo ("parseUser", withUser);
                query.Include ("parseUser");
                ParseObject self = null;
                try {
                    self = query.First;
                } catch (ParseException ex) {
                    // We may have a stall result from a previous registration
                    if (query.HasCachedResult) {
                        query.ClearCachedResult ();
                        try {
                            self = query.First;
                        } catch {
                            Android.Util.Log.Error ("Landing", "Error when trying to retrieve user 2. Normal if empty. {0}", ex.ToString ());
                        }
                    }
                    Android.Util.Log.Error ("Landing", "Error when trying to retrieve user. Normal if empty. {0}", ex.ToString ());
                }
                // First time ever, fill the info
                if (self == null) {
                    TabPerson person = null;
                    // Check if our TabPerson wasn't created indirectly by another user
                    query = new ParseQuery ("Person");
                    query.WhereEqualTo ("emails", TabPerson.MD5Hash (withUser.Email));
                    try {
                        person = TabPerson.FromParse (query.First);
                        person.AssociatedUser = withUser;
                    } catch {
                        // We use the main address email we got by parseUser
                        // and we will fill the rest lazily later from profile
                        // idem for the display name
                        person = new TabPerson {
                            AssociatedUser = withUser,
                            Emails = new string[] { withUser.Email }
                        };
                    }
                    return person;
                } else {
                    TabPerson.CurrentPerson = TabPerson.FromParse (self);
                    return null;
                }
            }).ContinueWith (t => {
                ctx.RunOnUiThread (() => {
                    // If the user was created, we setup a CursorLoader to query the information we need
                    if (t.Result != null) {
                        var person = t.Result;
                        person.DisplayName = profile.DisplayName;
                        person.Emails = profile.Emails.Union (person.Emails);
                        person.ToParse ().SaveEventually ();
                        TabPerson.CurrentPerson = person;
                    }

                    if (uiCallback != null)
                        uiCallback ();
                    ctx.Finish ();
                    ctx.StartActivity (typeof (MainActivity));
                });
            });
        }
        protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
        {
            base.OnElementChanged(e);

            if (!done)
            {
                // this is a ViewGroup - so should be able to load an AXML file and FindView<>
                activity = this.Context as Activity;
                if (App.IsGoogleLogin && !App.IsLoggedIn)
                {
                    /* ProgressDialog dlg = new ProgressDialog(Context);
                     dlg.SetTitle("Sign In To Google");
                     dlg.Show();*/

                    var myAuth = new GoogleAuthenticator("730990345527-h7r23gcdmdllgke4iud4di76b0bmpnbb.apps.googleusercontent.com",
                                     "https://www.googleapis.com/auth/userinfo.email",
                                     "https://accounts.google.com/o/oauth2/auth",
                                     "https://www.googleapis.com/plus/v1/people/me");
                    // dlg.Hide();

                    myAuth.authenticator.Completed += async (object sender, AuthenticatorCompletedEventArgs eve) =>
                    {

                        /* ProgressDialog dlg2 = new ProgressDialog(Context);
                         dlg2.SetTitle("Sign In To Google");
                         dlg2.Show();*/
                        if (eve.IsAuthenticated)
                        {
                            var user = await myAuth.GetProfileInfoFromGoogle(eve.Account.Properties["access_token"].ToString());
                            
							await App.SaveUserData(user,true);
                            App.IsLoggedIn = true;
							App.SuccessfulLoginAction.Invoke();
                        }
                        //  dlg2.Hide();
                    };

                    //auth.AllowCancel = false;
                    activity.StartActivity(myAuth.authenticator.GetUI(activity));
                    done = true;
                }
                else if (App.IsFacebookLogin && !App.IsLoggedIn)
                {
                    var auth = new OAuth2Authenticator(

						////- purposeColor facebook developer user id - [email protected] // passsword: ultimate.123

						clientId: "1064717540213918",
                        scope: "", // the scopes for the particular API you're accessing, delimited by "+" symbols
                        authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),//new Uri(""), // the auth URL for the service
                        redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html")); // the redirect URL for the service

                    auth.Completed += async (sender, eventArgs) => 
                    {
                        if (eventArgs.IsAuthenticated)
                        {
                            try
                            {
                                App.IsLoggedIn = true;
                                App.SaveToken(eventArgs.Account.Properties["access_token"]);
                                AccountStore.Create(activity).Save(eventArgs.Account, "Facebook");
                                // save user token  - to local DB
                            }
                            catch (System.Exception ex)
                            {
                                Console.WriteLine("auth.Completed ::: " + ex.Message);
                            }
							var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me?fields=id,name,email"), null, eventArgs.Account);
                           	await request.GetResponseAsync().ContinueWith(t =>
                            {
                                if (t.IsFaulted)
                                    Console.WriteLine("Error: " + t.Exception.InnerException.Message);
                                else
                                {
                                    string json = t.Result.GetResponseText();
                                    Console.WriteLine(json);
									SerialiseFacebookUserData (json);
                                }
                            });
							App.SuccessfulLoginAction.Invoke();
                        }
                        else
                        {
                            // The user cancelled
                        }
                    };
                    activity.StartActivity(auth.GetUI(activity));
                } // end - else if
            } //end - if (!done)
        }// end - OnElementChanged()
 public static void Launch(Activity ctx)
 {
     ctx.StartActivity(new Intent(ctx, typeof(DatabaseSettingsActivity)));
 }
Exemple #29
0
 public static void FinishAndForward(Activity activity, Intent i)
 {
     i.SetFlags(ActivityFlags.ForwardResult);
     activity.StartActivity(i);
     activity.Finish();
 }
        /// <summary>
        /// Logout from the system.
        /// </summary>
        /// <param name="activeActivity">Active activity used to start intent from.</param>
        public void Logout(Activity activeActivity)
        {
            userToken = null;

            var toLogin = new Intent(activeActivity, typeof(MainActivity));
            toLogin.AddFlags(ActivityFlags.NewTask | ActivityFlags.ClearTask);
            activeActivity.StartActivity(toLogin);
        }
Exemple #31
0
 public static void Login(Activity activity)
 {
     activity.StartActivity(typeof(Login));
 }
Exemple #32
0
 public static void Roles(Activity activity)
 {
     activity.StartActivity(typeof(RoleListEdit));
 }
		public static void StartUsing (string croppedPath, Activity activity)
		{
			var intent = new Intent (activity, typeof(CropResultActivity));
			intent.PutExtra (ExtraFilePath, croppedPath);
			activity.StartActivity (intent);
		}
Exemple #34
0
        public static void Launch(Activity act, String fileName, AppTask appTask)
        {
            File dbFile = new File(fileName);
            if ( ! dbFile.Exists() ) {
                throw new FileNotFoundException();
            }

            Intent i = new Intent(act, typeof(PasswordActivity));
            i.SetFlags(ActivityFlags.ForwardResult);
            i.PutExtra(KeyFilename, fileName);
            appTask.ToIntent(i);

            act.StartActivity(i);
        }
 public void Start(Activity context)
 {
     Intent i = new Intent(context, ActivityToLaunch);
     context.StartActivity(i);
 }
Exemple #36
0
		public static void onSignOutRequest(Activity _activity){
			new System.Threading.Thread(new System.Threading.ThreadStart(() => {
				//TCSignalRClient.getInstance().stop();
				if(MApplication.getInstance().tcSignalR != null){
					MApplication.getInstance().tcSignalR.stop();
				}
			})).Start();

			if (constants.isSignInFromSplashScreen) {
				constants.isSignInFromSplashScreen = false;
				Intent intent = new Intent (_activity, typeof(HomeActivity));
				_activity.StartActivity (intent);
			} else {
				_activity.SetResult (Result.Ok);
			}

			// Clear observer
			if (HomeDashBoard.homeDashBoardActivity != null) {
				TCNotificationCenter.defaultCenter.removeObserver (HomeDashBoard.homeDashBoardActivity, Constants.kPostNotifyAlertChange);
				try{
					HomeDashBoard.homeDashBoardActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if(SearchResultActivity.searchActivity != null){
				TCNotificationCenter.defaultCenter.removeObserver (SearchResultActivity.searchActivity, constants.kAddFavoriteSuccess);
				TCNotificationCenter.defaultCenter.removeObserver (SearchResultActivity.searchActivity, constants.kRemoveFavoriteSuccess);
				try {
					SearchResultActivity.searchActivity.Finish();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (SpecialistDetailActivity.specDetailActivity != null) {
				TCNotificationCenter.defaultCenter.removeObserver (SpecialistDetailActivity.specDetailActivity, Constants.kUpdateTalkNowStep);
				TCNotificationCenter.defaultCenter.removeObserver (SpecialistDetailActivity.specDetailActivity, constants.kDeferSuccess);
				try{
					SpecialistDetailActivity.specDetailActivity.Finish();
				} catch(Exception e){
					#if DEBUG
					Console.Write(e.Message);
					#endif
				}
				//SpecialistDetailActivity.specDetailActivity = null;
			}

			if (ListFavoriteActivity.listFavoriteActivity != null) {
				TCNotificationCenter.defaultCenter.removeObserver (ListFavoriteActivity.listFavoriteActivity, constants.kRemoveFavoriteSuccess);
				TCNotificationCenter.defaultCenter.removeObserver (ListFavoriteActivity.listFavoriteActivity, constants.kAddFavoriteSuccess);
				try {
					ListFavoriteActivity.listFavoriteActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (AlertActivity.eventActivity != null) {
				try {
					TCNotificationCenter.defaultCenter.removeObserver (AlertActivity.eventActivity, Constants.kPostDeleteFileSuccess);
					TCNotificationCenter.defaultCenter.removeObserver (AlertActivity.eventActivity, constants.kUpdateAlertWhenDeleteFileLocal);
					AlertActivity.eventActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (ConfirmedRequestsActivity.confirmedActivity != null) {
				TCNotificationCenter.defaultCenter.removeObserver (ConfirmedRequestsActivity.confirmedActivity, constants.kDeleteFileConfirmed);
				TCNotificationCenter.defaultCenter.removeObserver (ConfirmedRequestsActivity.confirmedActivity, Constants.kPostDeleteFileSuccess);
				try {
					ConfirmedRequestsActivity.confirmedActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if(PastBookingActivity.pastBookingActivity != null){
				TCNotificationCenter.defaultCenter.removeObserver (PastBookingActivity.pastBookingActivity, constants.kDeleteFilePast);
				TCNotificationCenter.defaultCenter.removeObserver (PastBookingActivity.pastBookingActivity, constants.kNotifyUpdateBookingInfo);
				TCNotificationCenter.defaultCenter.removeObserver (PastBookingActivity.pastBookingActivity, Constants.kPostDeleteFileSuccess);
				try {
					PastBookingActivity.pastBookingActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (PastHistoryDetail.pastDetailActivity != null) {
				TCNotificationCenter.defaultCenter.removeObserver (PastHistoryDetail.pastDetailActivity, Constants.kUpdateTalkNowStep);
				TCNotificationCenter.defaultCenter.removeObserver (PastHistoryDetail.pastDetailActivity, constants.kDeferSuccess);
				try {
					PastHistoryDetail.pastDetailActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (MyProfileActivity.myProfileActivity != null) {
				try {
					TCNotificationCenter.defaultCenter.removeObserver(MyProfileActivity.myProfileActivity, constants.kGetStatusCurrentUser);
					MyProfileActivity.myProfileActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (CallingDurationActivity.callingActivity != null) {
				TCNotificationCenter.defaultCenter.removeObserver (CallingDurationActivity.callingActivity, Constants.kPostStopCall);
				TCNotificationCenter.defaultCenter.removeObserver (CallingDurationActivity.callingActivity, Constants.kPostFolloUp);
				TCNotificationCenter.defaultCenter.removeObserver (CallingDurationActivity.callingActivity, Constants.kPostUploadFileSuccess);
				try {
					CallingDurationActivity.callingActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (BookingRequestsActivity.bookingActivity != null) {
				try {
					BookingRequestsActivity.bookingActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			if (ChangePasswordActivity.changePassActivity != null) {
				try {
					ChangePasswordActivity.changePassActivity.Finish ();
				} catch(Exception ex){
					#if DEBUG
					Console.Write(ex.Message);
					#endif
				}
			}

			try {
				_activity.Finish();
			} catch(Exception ex){
				#if DEBUG
				Console.Write(ex.Message);
				#endif
			}
		}