Flow:
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.
Try to set this Flags:
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
You are welcome!