简体   繁体   English

如何使用Android智能手机中的硬按钮终止应用程序?

[英]How to kill an app with the hard buttons in Android Smartphone?

In iOS device, we can kill a foreground app with the hard buttons. 在iOS设备中,我们可以使用硬按钮终止前台应用程序。 We can do it by the way written below: 1. Push down the power button and keep pushing 2. Wait for the power-off screen is shown 3. Push the Home button and keep pushing. 我们可以通过以下方式完成此操作:1.按下电源按钮并保持按下状态2.等待显示电源关闭屏幕3.按下Home按钮并保持按下状态。

If we use this way, the data of the foreground app that is not saved will go away. 如果使用这种方式,未保存的前台应用程序的数据将消失。

Usuually we only use this method when our device freezed, but some game players around me use it for other purpose. 通常,我们仅在设备冻结时才使用此方法,但是我周围的一些游戏玩家将其用于其他目的。
But I dont know the same method in Android. 但我不知道在Android中相同的方法。 Do you know the method to kill the foreground app with the hard button, and without running onPause()? 您是否知道在不运行onPause()的情况下使用硬按钮杀死前台应用程序的方法? If you know, could you tell me it? 如果知道,您能告诉我吗? *I am a (private) junior high school student in Japan. *我是日本的(私立)初中学生。 I think I am better at using English than public school students, but there may be some grammer mistakes, wrong collocation, or spelling mistakes. 我认为与公立学校的学生相比,我会更好地使用英语,但是可能存在一些语法错误,搭配错误或拼写错误。 So please read carefully. 因此,请仔细阅读。

Any answers or hints will be thanked. 任何答案或提示将不胜感激。

I'm waiting for your good answers or hints! 我正在等待您的好答案或提示!

If you mean killing an application screen progrmatically use - 如果您要杀死应用程序屏幕,请使用-


finish(); 完();

once you leave the activity for another screen, if you mean physically (using the device physical buttons) than a long push on the home button will show you all the apps running on the foreground swipe them to the left or to the right in order to terminate them However some apps uses services in order to fetch data or make logic operations which are unbound to the UI for those you should go to the "Application manager" on your device setting and kill them manually (by pressing stop) you can also use this app. 一旦您将活动离开另一个屏幕,如果您实际上是在意(使用设备的物理按钮),那么长按主屏幕按钮将向您显示在前台运行的所有应用程序,以便向左或向右滑动它们。终止它们但是,某些应用程序使用服务来获取数据或进行不绑定到UI的逻辑操作,对于那些应转到设备设置上的“应用程序管理器”并手动杀死它们(通过按Stop)的用户,也可以使用这个程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在移动 Android 智能手机上的 Chrome 浏览器中执行“硬页面重新加载” - How to do 'hard page reload' in Chrome browser on mobile android smartphone Android:如何为智能手机和平板电脑设计应用程序? - Android: how to the design app for Smartphone AND Tablet? android应用未出现在智能手机上 - android app not appearing on smartphone 如何在Android中杀死该应用或重启 - How to kill this app in android or restart 如何杀死Android应用程序onButtonClick - How to kill android app onButtonClick 我可以在Android智能手机上调试Android Wear应用程序吗? (如何) - Can I debug an Android Wear app on an Android smartphone? (and how) 如何在没有Logcat应用程序的Android智能手机中查找活动日志文件? - How to find activity log file in android smartphone without aLogcat app? 每5秒将数据写入android智能手机对硬盘来说是一个问题吗? - Is writing data to an android smartphone every 5 seconds a problem for the hard-disk? Android如何确定要杀死哪个应用程序? - How does Android decide which app to kill? 如何终止Android应用后台进程? - How to kill an Android app background process?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM