android - Clearing the Launcher Activity from the stack -


in app, have activity (launcher/main activity) ,b,c. launches b or c depending on if user authenticated.

now how remove such when button pressed exits app, not a. setting flag flag_activity_clear_top doesn't seem work.

@override public void onbackpressed{     super.onbackpressed();     finish(); // finish activity b or c      //also finish activity } 

i think need set

android:nohistory="true" 

on a. might need launch b/c these flags:

intent.addflags(intent.flag_activity_new_task | intent.flag_activity_clear_task);     

finally, can finish activities under current 1 in task stack same affinity calling:

finishaffinity() 

for further information: android: clear stack


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -