android - Close all activities and come to mobile's home screen -
when press log out button , come start(main) screen , when press button main screen comes 2nd screen. but, want close application on click of button main screen , close activities before that. while doing research found,
intent intent = new intent(this, home.class); intent.setflags(intent.flag_activity_clear_top); finish();
but not satisfying requirement.
you can use code referred here how exit application , show home screen?:
intent intent = new intent(intent.action_main); intent.addcategory(intent.category_home); intent.setflags(intent.flag_activity_new_task); startactivity(intent);
although android's design not favor exiting application choice.
related links:
Comments
Post a Comment