java - How to close certain activities after a certain screen? -
there 4 main activities:
profilemenu.class createnewprofilestepone.class createnewprofilesteptwo.class mainmenu.class suppose profilemenu.class, user chooses "create new profile" action. launches createnewprofilestepone.class, user enters data such name, address, etc. same goes on in createnewprofilesteptwo.class. @ point, user may freely go , forth between createnewprofilestepone , createnewprofilesteptwo data being saved , passed via intents. if user backs createnewprofilestepone.class, entered data lost, , user have enter scratch again.
after hitting "confirm profile" button in createnewprofilesteptwo.class activity, however, want send user mainmenu.class, kill previous activities profilemenu,createnewprofilestepone , createnewprofilesteptwo.
how kill 3 activities right enter mainmenu.class? know, finish() acts upon 1 , 1 activity--the current 1 called from. don't want kill a,b,or c until i'm ready enter d. , when enter d, want kill a,b,and c simultaneously.
when creating intent launch mainmenu add flag intent : intent.flag_activity_clear_top
intent = new intent(mycurrentactivity.this, mainmenu.class); i.addflags(intent.flag_activity_clear_top); startactivity(i); no history retained , user won't able go previous activities
Comments
Post a Comment