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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -