Reputation: 3851
I have to prevent back key functionality in my android application whenever the back key is pressed. This should be applied for whole app. I'm new to android programming. Does someone can help me with some helpful code segment?
Upvotes: 0
Views: 290
Reputation: 10069
You can change it by Overriding onBackPressed()
@Override
public void onBackPressed(){
// You can Customise your Back key Functionality Over here.
}
Upvotes: 0
Reputation: 2563
Subclass Activity and Fragment and override onBackPressed
. You cannot simply disable the back key globally.
Upvotes: 1