Skip to content

Instantly share code, notes, and snippets.

@untalfranfernandez
Created September 24, 2013 12:21
Show Gist options
  • Save untalfranfernandez/6683938 to your computer and use it in GitHub Desktop.
Save untalfranfernandez/6683938 to your computer and use it in GitHub Desktop.
How to know if your Android device has physical menu key.
public boolean hasPhysicalMenyKey(Context context) {
if (VERSION.SDK_INT <= VERSION_CODES.GINGERBREAD_MR1) {
return true;
} else if (VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB && VERSION.SDK_INT <= VERSION_CODES.HONEYCOMB_MR2) {
return false;
} else {
return ViewConfiguration.get(context).hasPermanentMenuKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment