From inside the Service class:
Intent dialogIntent = new Intent(this, MyActivity.class);
dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(dialogIntent);
But, this does not work from Android 10
+ due to battery optimisation restrictions
More Related Contents:
- application crashed due to regex function . which stops intent to switch from one to another activity [duplicate]
- How to manage startActivityForResult on Android
- How to send an object from one Android Activity to another using Intents?
- Example: Communication between Activity and Service using Messaging
- Android: Go back to previous activity
- Communication between Activity and Service
- Using Intent in an Android application to show another activity
- How can I return to a parent activity correctly?
- How do I pass data between Activities in Android application?
- Passing arraylist of objects between activities
- How to bring an activity to foreground (top of stack)?
- New Intent() starts new instance with Android: launchMode=”singleTop”
- How to make notification intent resume rather than making a new intent?
- Launch Skype from an App Programmatically & Pass Number – Android
- “Failure Delivering Result ” – onActivityForResult
- Intent – if activity is running, bring it to front, else start a new one (from notification)
- Android L (API 21) – java.lang.IllegalArgumentException: Service Intent must be explicit
- Where/How to getIntent().getExtras() in an Android Fragment? [duplicate]
- Android: Capturing the return of an activity
- Trying to UNINSTALL_SHORTCUT but shortcut won’t go away
- What is the meaning of android.intent.action.MAIN?
- Why does FLAG_ACTIVITY_CLEAR_TOP not work?
- Kotiln: pass data from adapter to activity
- Reasons that the passed Intent would be NULL in onStartCommand
- Passing a List to another Activity in Android
- Using startActivityForResult, how to get requestCode in child activity?
- Android: No Activity found to handle Intent error? How it will resolve
- Android: startActivityForResult & setResult for a view class and an activity class
- Update tabs from a tab’s activity in a Android TabHost
- Activity stack ordering problem when launching application from Android app installer and from Home screen