I navigate to the subsequent activities in my project and from one activity i want to come at the home screen...Please suggest the exact code for it.
Thanks
确认这个旧答案: 点击按钮后,Android将返回到第一个活动
The trick is to launch an Intent
with action set to ACTION_MAIN and a category of CATEGORY_HOME.
Something along the lines of:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
startActivity(intent);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.