简体   繁体   English

Android:在某些设备上按“主页”按钮后,应用程序将无法回家

[英]Android: app won't go home after home button press on some devices

I am developing an Android app. 我正在开发一个Android应用程序。 When the app is running in the emulator or on my Moto 4G or the Google Pixel and I press the home button, I am going home (as expected). 当应用程序在仿真器中,Moto 4G或Google Pixel上运行并且按主页按钮时,就可以回家了(如预期的那样)。

However, when I run the app on an Acer E380 and I press the home button, nothing happens, although other apps on the same mobile phone don't have this issue. 但是,当我在Acer E380上运行该应用程序并按“主页”按钮时,没有任何反应,尽管同一部手机上的其他应用程序没有此问题。

The emulator, Moto 4G and Acer E380 are running on Android 4.4.2. 模拟器Moto 4G和Acer E380在Android 4.4.2上运行。

I have no code that tries to detect a home button press. 我没有尝试检测主页按钮按下的代码。

What could be the problem here? 这可能是什么问题?

have you using below code ? 您是否使用以下代码?

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {     

    if(keyCode == KeyEvent.KEYCODE_HOME)
    {
       //The Code Want to Perform. 
    }
});

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM