Hardware buttons cannot be activated in Android emulator

I work in Android Studio 1.0 RC 2 and I have an Android emulator with Intel HAXM. The emulator is working fine. It shows hardware buttons, but these buttons are not available. The default AVD configuration is for the Nexus S, but the scale is 0.5.

+5
source share
4 answers

Based on @CommonsWare comment

@Plugie: I never use these skins, and I donโ€™t know that these buttons should ever be interactive.

I recommend setting hw.mainKeys = no

Go to the actual configuration file for your AVD. On OS X and Linux, this is usually ~ / .android / avd /.../ config.ini, where ... is based on the name of your AVD. See what the value of hw.mainKeys is

After setting hw.mainKeys = no, it will display the System Panel, which can be seen on the screen in which there is a red rectangle. Then you can navigate BACK, HOME using the system panel instead of the hardware button

nexus s with hw.mainKeys = no

+3
source

It shows hardware buttons, but these buttons are not viewable.

If HOME and BACK are displayed on the navigation bar, they are not โ€œhardware buttonsโ€. This is a navigation bar. For the real "hardware" buttons "HOME" and "BACK" you will not see anything, and on your keyboard the developer displays on Home and Esc .

Go to the actual configuration file for your AVD. On OS X and Linux, this is usually ~/.android/avd/.../config.ini , where ... based on the name of your AVD. See what your hw.mainKeys value hw.mainKeys . For the "hardware" buttons HOME and BACK hw.mainKeys should be yes ; for the navigation bar with the HOME and BACK hw.mainKeys should be no .

+3
source

To do this, you probably need to change some settings of your emulator. Change the skin to "Leather with dynamic hardware controls" and make sure that the "Hardware keyboard present" box is checked. Not sure if this is a solution, but give it a try.

+1
source

For me, it required a bit more work. In short, avd incorrectly creates an android image by setting dPad and mainKey to "no". This post helped http://ridz1ba.blogspot.ru/2012/12/android-virtual-devices-avd-problem-on.html

0
source

Source: https://habr.com/ru/post/1208161/


All Articles