Does the Android Guide app support disabling the Default and Back features for a specific app?

There are several buttons in my application that are very close to the default back button of this device and the menu button. Thus, I had problems clicking this “My Applications” button, which is next to the “Menu” and “Back” buttons.

So, for this purpose, I want to disable the default return and menu button.

Thus, the development of Android applications Guideline allows, if we want to disable the back panel and menu button during a specific application? If so, how is this possible?

Thanks.

+1
source share
2 answers

So, does the Guideline Android application development, if we want to disable the back panel and menu button during the daily application?

The programming guide for any OS (Windows, Mac, iOS, Android, etc.) does not violate the default behavior .

The user will expect that your application supports the default behavior of the device that he uses, and in most cases bought the device for this reason: he / she uses the default behavior. If he / she wants a different type of user interaction, he or she would buy a different type of device.

There are several buttons in my application that are very close to the default back button for this device and the menu button

While your button is on the screen, I don’t see how this can become a problem. If, however, this is a problem, a better solution than overriding the default behavior is to move or enlarge your buttons to make it easier for the user to hit them. p>

If so, how is this possible?

Yes, it can be done.

To disable the back button, simply override onBackPressed() in all Activity problems and leave it blank:

 public void onBackPressed() { //Do nothing } 

The Menu button will only be a problem if you are inflating a menu from Activity . The standard behavior is that nothing happens when you press the Menu button until you tell your Activity to do something.

+4
source

Sometimes you need to override the default behavior, fx, if you use views, and the user expects a transition to view between views. In other cases, something else, it all depends on the application. I would recommend considering whether to override the default behavior or not.

Here is another example that you can use for all buttons:

 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_BACK) && (isSomething)) { something(); return true; } return super.onKeyDown(keyCode, event); } 
+1
source

All Articles