I am writing a application where I am dealing with 4 activities, let\'s say A, B, C & D. Activity A invokes B, B invokes C, C invokes D. On each of the activity, I have
The only problem i see using android:launchMode="singleTask" is whenever you minimize app and start app by pressing app icon again then app start from scratch and doesn't acquire its state. so i have opted to use
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
which will keep only one instance and clear all activities on top of that.
Intent intent = new Intent( context, MyActivity.class );
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
current_activity.startActivity( intent );