Android: Run Activity from Background
I have some Activities, activity A in which I start new activity B in new Task, so A goes to backgroung with it Task..in B I start C and from C i need to start A...i need to come back to first Task开发者_JAVA百科. How to do that ? Thanks !
Use intents with Intent Flags.
Intent intent= new Intent(CurrentActivity.this, DestinationActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
This should be used to start new activity , For example B and C in your case.
and
Intent intent= new Intent(CurrentActivity.this, DestinationActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
can be used to relaunch A in your case. Hope this helps.
精彩评论