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
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main. xml. In the above code, we have taken text view, when user gets the data from intent service it will update.
Clients may use Context. startService(intent) to submit a request to start a Service (Intent). A worker thread is generated here, and all requests are handled by the worker thread, but only one request is processed at a time. To use IntentService, you must extend it and enforce the onHandleIntent (android.
Intent dialogIntent = new Intent(getBaseContext(), MainActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplication().startActivity(dialogIntent);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With