Reputation: 155
I have Service implements IntentService and in the OnHandleIntent I want to start activity.
It does not work:
Intent dialogIntent = new Intent(this, typeof(Activity1));
dialogIntent.AddFlags(ActivityFlags.NewTask);
this.StartActivity(dialogIntent);
what else can I try?
upd: AddFlags(ActivityFlags.NewTask); it doesnt help
Upvotes: 5
Views: 7167
Reputation: 328
Intent dialogIntent = new Intent(getBaseContext(), MainActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(dialogIntent);
Upvotes: 9