In android how to close entire application with logout button -


i have activity a, b & c , went a-> c-> b-> @ final activity have 1 logout button, , on click of it, how finish entire application previous activities , stacks.

try this,

intent intent = new intent(mainactivity.this, loginactivity.class) .setflags(intent.flag_activity_clear_top); finish(); intent.addflags(intent.flag_activity_new_task); intent.addflags(intent.flag_activity_clear_task); startactivity(intent); 

if have session, please clear session before intent have been called.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -