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


C# Context.StartActivity方法代码示例

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


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

示例1: GetView

		public override View GetView (Context context, View convertView, ViewGroup parent)
		{
			View view = base.GetView (context, convertView, parent);
			view.Click += delegate {
				if (TestCase.RunState != RunState.Runnable)
					return;
								
				AndroidRunner runner = AndroidRunner.Runner;
				if (!runner.OpenWriter ("Run " + TestCase.FullName, context))
					return;
				
				try {
					//Test.Run (runner);
					runner.Run (TestCase);
				} finally {
					runner.CloseWriter ();
				}

				if (Result.ResultState.Status != TestStatus.Passed) {
					Intent intent = new Intent (context, typeof(TestResultActivity));
					intent.PutExtra ("TestCase", Name);
					intent.AddFlags (ActivityFlags.NewTask);			
					context.StartActivity (intent);
				}
			};
			return view;
		}
开发者ID:pjcollins,项目名称:Andr.Unit,代码行数:27,代码来源:TestCaseElement.cs

示例2: OpenGallery

 public static void OpenGallery(Context context)
 {
     Intent intent = new Intent(Intent.ActionView);
     intent.SetType("image/*");
     intent.SetFlags(ActivityFlags.NewTask);
     context.StartActivity(intent);
 }
开发者ID:es-repo,项目名称:wlpgnr,代码行数:7,代码来源:IntentShortcuts.cs

示例3: Show

 /**
  * Starts the activity, using the supplied driver instance.
  *
  * @param context
  * @param driver
  */
 public static void Show(Context context, UsbSerialPort port)
 {
     mUsbSerialPort = port;
     Intent intent = new Intent(context, typeof(SerialConsoleActivity));
     intent.AddFlags(ActivityFlags.SingleTop | ActivityFlags.NoHistory);
     context.StartActivity(intent);
 }
开发者ID:JamieHouston,项目名称:usb-serial-for-xamarin-android,代码行数:13,代码来源:SerialConsoleActivity.cs

示例4: SocialAuthController

 public SocialAuthController(AccountOAuth.OAuthTypes providerType, Context c)
 {
     this.ProviderType = providerType;
     int type = 0;
     switch (providerType)
     {
         case AccountOAuth.OAuthTypes.FaceBook:
             type = 1;
             break;
         case AccountOAuth.OAuthTypes.Twitter:
             type = 2;
             break;
         case AccountOAuth.OAuthTypes.LinkedIn:
             type = 3;
             break;
         case AccountOAuth.OAuthTypes.Google:
             type = 4;
             break;
         case AccountOAuth.OAuthTypes.YouTube:
             type = 5;
             break;
     }
     Intent i = new Intent(c, typeof(WebViewer));
     i.PutExtra("type", type);
     c.StartActivity(i);
 }
开发者ID:chimpinano,项目名称:WowZapp-Android,代码行数:26,代码来源:SocialAuthController.cs

示例5: SendLoginAsync

		private async Task<Auth0User> SendLoginAsync(
			Context context, 
			string connection, 
			bool withRefreshToken,
			string scope)
		{
			// Launch server side OAuth flow using the GET endpoint
			scope = IncreaseScopeWithOfflineAccess(withRefreshToken, scope);

			var tcs = new TaskCompletionSource<Auth0User> ();
			var auth = await this.GetAuthenticator (connection, scope);

			auth.Error += (o, e) =>
			{
				var ex = e.Exception ?? new AuthException (e.Message);
				tcs.TrySetException (ex);
			};

			auth.Completed += (o, e) =>
			{
				if (!e.IsAuthenticated) 
				{
					tcs.TrySetCanceled();
					return;
				}

				this.SetupCurrentUser (e.Account.Properties);
				tcs.TrySetResult (this.CurrentUser);
			};

			Intent intent = auth.GetUI (context);
			context.StartActivity (intent);

			return await tcs.Task;
		}
开发者ID:MMalikKhan,项目名称:TaskTimerApp,代码行数:35,代码来源:Auth0Client.Android.cs

示例6: SignInComplete

        public static void SignInComplete(AuthenticationResult aresult, Context context)
        {
            App.AuthenticationContext = authContext;

            context.StartActivity(typeof(IncidentActivity));
            ((Activity)context).Finish();
        }
开发者ID:rajendra1809,项目名称:Property-Inspection-Code-Sample,代码行数:7,代码来源:MainActivity.cs

示例7: OnReceive

		private const long WIDGET_REFRESH_DELAY_MS = 5000; //5 Seconds


			public override void OnReceive(Context context, Intent intent) {

			// Refresh the widget after a push comes in
			if (PushManager.ActionPushReceived == intent.Action) {
				RichPushWidgetUtils.RefreshWidget(context, WIDGET_REFRESH_DELAY_MS);
			}

			// Only takes action when a notification is opened
			if (PushManager.ActionNotificationOpened != intent.Action) {
				return;
			}

			// Ignore any non rich push notifications
			if (!RichPushManager.IsRichPushMessage(intent.Extras)) {
				return;
			}

			string messageId = intent.GetStringExtra(EXTRA_MESSAGE_ID_KEY);
			Logger.Debug("Notified of a notification opened with id " + messageId);

			Intent messageIntent = null;

			// Set the activity to receive the intent
			if ("home" == intent.GetStringExtra(ACTIVITY_NAME_KEY)) {
				messageIntent = new Intent(context, typeof (MainActivity));
			} else {
				// default to the Inbox
				messageIntent =  new Intent(context, typeof (InboxActivity));
			}

			messageIntent.PutExtra(RichPushApplication.MESSAGE_ID_RECEIVED_KEY, messageId);
			messageIntent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop | ActivityFlags.NewTask);
			context.StartActivity(messageIntent);
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:37,代码来源:PushReceiver.cs

示例8: OpenUrl

 void OpenUrl(Context context)
 {
     Intent intent = new Intent(context, typeof(HtmlActivity));
     intent.PutExtra("URL", this.Url.ToString());
     intent.AddFlags(ActivityFlags.NewTask);
     context.StartActivity(intent);
 }
开发者ID:benhorgen,项目名称:MonoCross-Example,代码行数:7,代码来源:HtmlElement.cs

示例9: onCallStateChanged

        public void onCallStateChanged(string state, string incomingNumber, Context _context)
        {
            // TODO React to incoming call. // React to incoming call. string number=incomingNumber;
            //screen =_Context.FindViewById<ViewGroup>(Resource.Id.IncomingCall);
            // If phone ringing
            if(state == TelephonyManager.ExtraStateRinging )
            {

                /*var i = new Intent(_context, typeof (PlayerSevise));
                i.PutExtra(PlayerSevise.CommandExtraName, PlayerSevise.PlayCommand);
                _context.StartService (i);*/

                var i = new Intent(_context, typeof (CallActivity));
                i.SetFlags (ActivityFlags.NewTask);
                _context.StartActivity (i);

                //Toast.MakeText(this, " Phone Is Riging ", ToastLength.Long).Show()
                //Toast.MakeText(_context,"phone is neither ringing nor in a call", ToastLength.Long).Show();

                }
            if (state == TelephonyManager.ExtraStateIdle) {
                /*var i = new Intent(_context, typeof (PlayerSevise));
                i.PutExtra(PlayerSevise.CommandExtraName, PlayerSevise.StopCommand);
                _context.StartService (i);*/
            }

            if (state == TelephonyManager.ExtraStateOffhook) {
                /*var i = new Intent(_context, typeof (PlayerSevise));
                i.PutExtra(PlayerSevise.CommandExtraName, PlayerSevise.StopCommand);
                _context.StartService (i);*/
            }
        }
开发者ID:GeniusAtamans,项目名称:VideoBuyApp,代码行数:32,代码来源:CallResiver.cs

示例10: Email

 public static void Email(Context context, string to, string subject, string message)
 {
     Intent i = new Intent(Intent.ActionView);
     string uri = "mailto:" + to +  "?subject=" + subject + "&body=" + message;
     i.SetData(Uri.Parse(uri));
     i.PutExtra(Intent.ExtraEmail, new[] { to });
     context.StartActivity(i);
 }
开发者ID:es-repo,项目名称:wlpgnr,代码行数:8,代码来源:IntentShortcuts.cs

示例11: goToGitHub

        public static void goToGitHub(Context context)
        {
			//
            //Uri uriUrl = Uri.Parse("http://github.com/jfeinstein10/slidingmenu");
			Uri uriUrl = Uri.Parse("https://github.com/skywolf888/SlidingMenu.Net");
            Intent launchBrowser = new Intent(Intent.ActionView, uriUrl);
            context.StartActivity(launchBrowser);
        }
开发者ID:skywolf888,项目名称:SlidingMenu.Net,代码行数:8,代码来源:Util.cs

示例12: callEnded

 public void callEnded(Context context)
 {
     if (Globals.CALLED == true) {
         var intent = new Intent (context, typeof(AfterCallActivity));
         intent.AddFlags (ActivityFlags.NewTask);
         context.StartActivity (intent);
     }
 }
开发者ID:Chirojeugd-Vlaanderen,项目名称:ChiroApp,代码行数:8,代码来源:CallStateListener.cs

示例13: OpenUrl

 private void OpenUrl(Context context)
 {
     var intent = new Intent(context, typeof (HtmlActivity));
     intent.PutExtra("URL", Url.ToString());
     intent.PutExtra("Title", Caption);
     intent.AddFlags(ActivityFlags.NewTask);
     context.StartActivity(intent);
 }
开发者ID:indazoo,项目名称:MvvmCross_DesignData,代码行数:8,代码来源:HtmlElement.cs

示例14: OnReceive

        public override void OnReceive(Context context, Intent intent)
        {
            if (intent.Action == "BOOT_COMPLETED")
            {
                Intent explicitIntent = new Intent(context, typeof(Alarms));
                context.StartActivity (explicitIntent);

            }
        }
开发者ID:MatejVukosav,项目名称:GdjeMiJeAuto,代码行数:9,代码来源:DeviceBootReceiver.cs

示例15: GetView

		public override View GetView (Context context, View convertView, ViewGroup parent)
		{
			View view = base.GetView (context, convertView, parent);
			view.Click += delegate {
				Intent intent = new Intent (context, activity);
				intent.AddFlags (ActivityFlags.NewTask);			
				context.StartActivity (intent);
			};
			return view;
		}
开发者ID:TimeIncOSS,项目名称:Andr.Unit,代码行数:10,代码来源:ActivityElement.cs


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