本文整理汇总了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;
}
示例2: OpenGallery
public static void OpenGallery(Context context)
{
Intent intent = new Intent(Intent.ActionView);
intent.SetType("image/*");
intent.SetFlags(ActivityFlags.NewTask);
context.StartActivity(intent);
}
示例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);
}
示例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);
}
示例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;
}
示例6: SignInComplete
public static void SignInComplete(AuthenticationResult aresult, Context context)
{
App.AuthenticationContext = authContext;
context.StartActivity(typeof(IncidentActivity));
((Activity)context).Finish();
}
示例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);
}
示例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);
}
示例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);*/
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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;
}