I’m going to post the comment of @H9kDroid as the best answer here for people that have a similar question.
You can use isTaskRoot() to know whether the activity is the root of a task.
I hope this helps
More Related Contents:
- Android app out of memory issues – tried everything and still at a loss
- Android Application Class Lifecycle
- android finish() method doesn’t clear app from memory
- How to test code built to save/restore Lifecycle of an Activity?
- Android Fragment onCreateView vs. onActivityCreated
- how to send string from one activity to another without starting second activity [duplicate]
- How to send an object from one Android Activity to another using Intents?
- How to handle screen orientation change when progress dialog and background thread active?
- How to send string from one activity to another?
- Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?
- How to check if activity is in foreground or in visible background?
- Passing Data Between Fragments to Activity
- Android: how do I check if activity is running?
- Notification click: activity already open
- Losing data when rotate screen
- Stopping & starting music on incoming calls
- Android – startActivityForResult immediately triggering onActivityResult
- How can I add an animation to the activity finish()
- Starting Activity from Fragment causes NullPointerException
- Android: Capturing the return of an activity
- How to correctly start activity from PostExecute in Android?
- Don’t keep activities – What is it for?
- Determining if an Activity exists on the current device?
- Activity killed / onCreate called after taking picture via intent
- How to replace a Fragment on button click of that fragment?
- Start service in Android
- Activity.finish() called but activity stays loaded in memory
- Android 4.4.2 – java.lang.RuntimeException: Performing stop of activity that is not resumed
- onActivityResult With launchMode=”singleTask”?
- Android change layout dynamically