How to start activity from intentservice?

android, broadcastreceiver, intentservice

Solution

Intent dialogIntent = new Intent(getBaseContext(), MainActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(dialogIntent);

Problem

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

Original source

Related problems