I have a user case like this:
Activity A -> B -> C ->D.
In the Activity D, I want to get开发者_C百科 back to the Activity A. I tried with Intent and it is okay, however, instead of reusing the existing one, it created a new one. Anyone please let me know how to cope it?
Thank a lot!
There is a fine topic on developer.android regarding exactly this question, check it out: avoiding memory leaks
You need to set the flags on the intent when you start A again
Intent i = new Intent(this, ActivityA.class);
i.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(i);
see public Intent setFlags (int flags)
for reference
精彩评论