android - Intent.FLAG_ACTIVITY_CLEAR_TOP not working -


my application flow:

login->profile->updateprofile->changepass

all of activitys extends fragmentactivity

when press button in changepass activity call code:

intent intent=new intent(getapplicationcontext(),loginactivity.class); intent.setflags(intent.flag_activity_clear_top); startactivity(intent); 

so should start loginactivity , when press loginactivity application should close...but when press button login activity flow is:

changepass->updateprofile->profile->login

why stack not cleared ?

note:

i have applied these solutions not working: 1.link 2.link

try following way -

 intent intent = new intent(getactivity(), loginactivity.class);  intent.addflags(intent.flag_activity_clear_top | intent.flag_activity_new_task);  intent.addflags(intent.flag_activity_no_history);  startactivity(intent);  finish(); 

for more alternatives , details check intent-flag-activity-clear-top-doesn't-deletes-the-activity-stack. post explains result code , above solution.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -