I wanted to know if there was a way to detect if the device have "on screen buttons" (like the Galaxy Nexus or ICS tablets)
My issue is that in devices with on screen button, on the action, bar the overflow button is added (if overflow), and not on other devices, so I would like to be able to predict this kind of behavior.
Thank you for your help.
From your Activity you can run the following command:
boolean hasNavigationBar = false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
{
hasNavigationBar = !ViewConfiguration.get(context).hasPermanentMenuKey();
}
else
{
hasNavigationBar = false;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With