android开发怎么退出程序

2025-04-15 09:38:51
推荐回答(3个)
回答1:

ThenActivity.this.finish();//结束当前Activity
Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(startMain);
System.exit(0);// 退出程序

将上面这几句代码放到你的退出程序按钮的点击事件里面就可以了!

回答2:

请关机 关机

回答3:

直接关掉啦