android - How to check if back/home buttons are touch or hardware buttons? -


I am trying to make a snake game. I'm testing the game on my Nexus 4, which was seeing it back / home buttons as a touch button, when I wanted to do full screen activity, the touch button will show up on the activity so that I will use the following code:

  view.setSystemUiVisibility (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);   

But when I tested the game on my friend's Sony Ericsson phone, which has hardware buttons, so on my phone it is more spreading to the area behind the bottom edge of the screen. How can I fix this?

I'm getting the screen size like this:

  DisplayMetrics metrics = new DisplayMetrics (); . GetWindowManager () getDefaultDisplay () getMetrics (matrix). Height = metrics High pixel; Width = metrics.widthPixels;  

I'm 99% confident that they are similar to the program to trigger a signal Uses your body's electrical resistance, the second uses mechanical switches, it's like a door knob, it can be round, or it can have a handle if you have a UI to copy an actual button Talking about the overlay, it is well hidden in the OS and at your level In the previous case, the door knob analogy, it is now an automatic opening: -)

But to give you a solution .. your own GUI in AP Create buttons and do not trust the hardware.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -