How to get started with intenservice?

I have a Service that implements IntentService in OnHandleIntent as well. I want to get started.

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); he does not help

+4
source share
1 answer
Intent dialogIntent = new Intent(getBaseContext(), MainActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(dialogIntent);
+7
source

Source: https://habr.com/ru/post/1541241/


All Articles