how do i disable the back button function to do nothing ?
+3
A:
You need to override function
onBackPressed()
of your current Activity.
Desiderio
2010-10-24 11:22:54
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
2010-10-24 11:25:37
Agreed, any violation from normal app behaviour is not encouraged.
Desiderio
2010-10-24 11:41:14
@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
2010-10-24 11:43:22
@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
2010-10-24 11:52:02
@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
2010-10-24 19:47:00