Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine on screen soft buttons android

I am working on android application . In which I have to set image on specific position on screen. Problem comes up when on screen button like in this image comes up!enter image description here

I googled alot but didn't find any help. Is there any way programatically to detect these on screen buttons ? Thank you for your help.

like image 517
Ahmed Avatar asked Nov 03 '22 04:11

Ahmed


1 Answers

you can check for hasPermanentMenuKey using

boolean hasMenuKey = ViewConfiguration.get(context).hasPermanentMenuKey();

if that returns true it means you dont have the soft keys.

regarding different APIs level don't worry about honeycomb because they don't have soft keys, for more read on different APIs please refer to this answer.

Report if the device has a permanent menu key available to the user.

As of Android 3.0, devices may not have a permanent menu key available. Apps should use the action bar to present menu options to users. However, there are some apps where the action bar is inappropriate or undesirable. This method may be used to detect if a menu key is present. If not, applications should provide another on-screen affordance to access functionality.

like image 127
Ahmad Kayyali Avatar answered Nov 12 '22 14:11

Ahmad Kayyali