views:

67

answers:

1

Hi,

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

+1  A: 

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);
Brian
these flags seem to be what I amafter, but none of them work. Anything special that need to get into the manifest file ?
kellogs
marked as answer. I was not overriding the onDestroy method, but onStop, and that is why I got confused. However, it is still srange that Android decides to destroy that activity (part of the current running task) while system load is almost 0.
kellogs