Flow:
- Open app (MainActivity)
- Press home button ( calling onPause() in activity )
Starting same activity, with different intent
Intent intent = Utils.createIntent(....., this, MainActivity.class); // this will add some extra to our intent intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); startActivity(intent);
Nothing happens.
onCreate() gets called. (onDestroy wasn't called)
onResume() is called
My activity in xml
<activity
android:name=".ui.activities.MainActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" />
NOte: if I don't press home button (app doesn't pause), onNewIntent will be called correctly.