Question

is there a way to tell Android that I would like subsequent calls to startActivity() all resume the target activity rather than creating it over and over again ? Any workarounds ?

Thanks

Was it helpful?

Solution

Depending on your needs, try using FLAG_ACTIVITY_CLEAR_TOP or FLAG_ACTIVITY_REORDER_TO_FRONT when creating your intent:

Intent intent = new Intent(this, NameOfActivityClass.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top