tags:

views:

48

answers:

1

how do i disable the back button function to do nothing ?

+3  A: 

You need to override function

onBackPressed()

of your current Activity.

Desiderio
though you should not do that without a good reason. User expects the back button to return them to whatever they were doing previously, and you might be violating their expectation if you disable the back button without a good reason.
Lie Ryan
Agreed, any violation from normal app behaviour is not encouraged.
Desiderio
@Lie Ryan: I have a Droid 2 (Android 2.2), and my "user expectation" of the back button is that it's going to do whatever crazy $#!+ the programmer decided it was going to do. It's not very consistently applied, at least in the apps I use.
MusiGenesis
@MusiGenesis: Uninstall the poor apps, or if it's system program that comes with your phone, return your phone to the shop and get a better android phone.
Lie Ryan
@Lie Ryan: Kindle is one of the worst offenders, yet is still my most-used app. I prefer to keep my apps but bitch about them - my right.
MusiGenesis