Android: Clear Activity Stack -


i want o clear activities after clicking on logout button. used following code. please tell me correct way implement it.

public class logoutlistner implements onclicklistener {      private activity mactivity;      public logoutlistner(activity a) {         this.mactivity = a;     }      @override     public void onclick(view arg0) {         intent intent = new intent(mactivity, loginactivity.class);         intent.setflags(intent.flag_activity_clear_top | intent.flag_activity_no_history);         mactivity.startactivity(intent);     } 

intent intent = new intent(mactivity, loginactivity.class); intent.addflags(intent.flag_activity_clear_top); intent.addflags(intent.flag_activity_new_task); mactivity.startactivity(intent); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -