I have 3 Acivity based application, It’s work flow like this MainActivity ListView and DetailView. when onResume event trigger , need to call MainActivity. without going to other two activity.
Is there any way to call MainActivity when onResume event trigger?
Thank You
You can set the
android:clearTaskOnLaunch="true"attribute for you MainActivity in the AndroidManifest.xml file. See here to find why and more details. I think this is the most convenient way to meet your demand.Edit:
I just tested and found this only works when you exit the app and launch the app from the app drawer(NOT long press on HOME and select the app).
If you want to always bring the root activity to the front, no matter when you re-launch the app or from the recent screen. You can declare
"android:launchMode="singleTask"for the root activity, here, the MainActivity.