I am having an edit text, and while the user is entering data in it, i want the back button to be disabled. Please help if anyone has done this before.
Asked
Active
Viewed 518 times
0
-
Did you try to override onBackPressed method? – ACengiz Apr 26 '13 at 19:21
2 Answers
1
You can override the onBackPressed() method of your activity.
But please think about this twice. Normally this is nothing the user would expect.
-
Hi thanks for the reply, but i want to stop back button only when the edittext is on, rest of the time, i want the user to use the back button, inside edittext can we do this? – bharath Apr 26 '13 at 19:56
-
Also, this is not working for edittext if i place this in the main activity! – bharath Apr 26 '13 at 19:58
0
Try using this link: Disable back button in android
@Override
public void onBackPressed() {
}
Requires API Level 5 or higher
.
This is a duplicate question and this answer seems to do what you want.