In my app, I navigate from MainActivity to Activity B. I then press the HOME button and then click on the app icon again to maximize it.
Instead of onResuming my Activity B, it goes back to MainActivity.
This makes sense because in my AndroidManifest.xml, I'm using the normal intent-filters to launch the MainActivity when you click on its icon:
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="MyApp"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
I was checking popular apps like facebook and twitter, none of them seem to experience this problem - when you navigate from your facebook feed to a friends page and then press the HOME button. Then you click on the app icon again and it is still on your friend's page.
This only seems to affect the app when I click on the app icon. If for example go from MainActivity to Activity B, press HOME button and then press the SQUARE button to show all my apps running in the background, select my app that is in the background to maximize it again, the app will return back correctly to Activity B.
How do I make sure that when you click on the app icon, it onResumes
Activity B instead?