Could you explain in more detail? If I understand your problem, try setting FLAG_ACTIVITY_NO_HISTORY.
Alternatively, a manual solution would be to check FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY for intent in MyActivity and start the main asset if you see this flag. The following code should do this:
if ((getIntent().getFlags() & FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY) > 0) {
activity.startActivity(new Intent(context , MainActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
}
source
share