当前位置: 首页>>代码示例>>C#>>正文


C# Activity.StartActivity方法代码示例

本文整理汇总了C#中Android.App.Activity.StartActivity方法的典型用法代码示例。如果您正苦于以下问题:C# Activity.StartActivity方法的具体用法?C# Activity.StartActivity怎么用?C# Activity.StartActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.App.Activity的用法示例。


在下文中一共展示了Activity.StartActivity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainActivityViewModel

        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)));
        }
开发者ID:neuecc,项目名称:ReactiveProperty,代码行数:10,代码来源:MainActivityViewModel.cs

示例2: Start

		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 ());
			}
		}
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:11,代码来源:SignInActivity.cs

示例3: StartTargetActivity

		/// <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);
			}
		}
开发者ID:lq-ever,项目名称:CommunityCenter,代码行数:19,代码来源:EldYoungUtil.cs

示例4: ActivityRoutedViewHost

        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);
                });
        }
开发者ID:rollingthunder,项目名称:ReactiveUI,代码行数:33,代码来源:ActivityRoutedViewHost.cs

示例5: StartQuizActivityWithTransition

		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);
		}
开发者ID:raulma,项目名称:monodroid-samples,代码行数:8,代码来源:CategorySelectionFragment.cs

示例6: Show

        public void Show(Activity activity)
        {
            Validate();

            var i = FillIntent();
            activity.StartActivity(i);
            activity.OverridePendingTransition(AnimationEnterInResource, AnimationEnterOutResource);
        }
开发者ID:edub9,项目名称:XamarinPasscode,代码行数:8,代码来源:PasscodeManager.cs

示例7: ShowDonateReminderIfAppropriate

        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)));
                    }
                }
            }
        }
开发者ID:pythe,项目名称:wristpass,代码行数:19,代码来源:DonateReminder.cs

示例8: MainActivityViewModel

        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));
                });
        }
开发者ID:gotenkusu48,项目名称:tt,代码行数:21,代码来源:MainActivityViewModel.cs

示例9: ActivityRoutedViewHost

        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);
                });
        }
开发者ID:Omgan,项目名称:ReactiveUI,代码行数:37,代码来源:ActivityRoutedViewHost.cs

示例10: startThisActivity

 public static void startThisActivity(Activity activity)
 {
     activity.StartActivity(new Intent(activity, typeof(Sample2Activity)));
 }
开发者ID:huguodong,项目名称:CircularProgressButton,代码行数:4,代码来源:Sample2Activity.cs

示例11: LaunchApp

        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));
                });
            });
        }
开发者ID:Andrea,项目名称:FriendTab,代码行数:64,代码来源:LandingActivity.cs

示例12: Launch

        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);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:16,代码来源:EntryActivity.cs

示例13: Login

 public static void Login(Activity activity)
 {
     activity.StartActivity(typeof(Login));
 }
开发者ID:ChrisWay,项目名称:csla,代码行数:4,代码来源:GlobalActivities.cs

示例14: Logout

        /// <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);
        }
开发者ID:prozum,项目名称:solitude,代码行数:12,代码来源:CommunicationInterface.cs

示例15: StartNewActivity

 /// <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);
 }
开发者ID:favn1585,项目名称:CiklumTweets,代码行数:10,代码来源:CommonUtils.cs


注:本文中的Android.App.Activity.StartActivity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。