Hello,
I have come across a small issue where I want to stop the back button from going back to the previous activity.
I have been using the following code to do this:
However the above code didn't work and it just closed my activity and loaded the previous activity.
I then searched the forum and found some code that Erel posted:
This code works fine.
However I did notice that Erel posted 'I see it too. This will be fixed in the next update.' however I am not sure if I have done something wrong in my code or if this hasn't been fixed in v3.00 (as this is the version I am using)?
http://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/
I have the same issue on Android my Samsung Galaxy S2 (running Android 2.3.6) and on my Sony Xperia Z (running Android 4.2.2).
However to get past this issue I had to use the code above (2nd lot of code above) to fix this issue.
Through I would share this in case someone else gets the same issue. (unless I am doing something wrong and the 1st lot of code shouldn't of worked?)
I have come across a small issue where I want to stop the back button from going back to the previous activity.
I have been using the following code to do this:
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
Return
End If
End Sub
However the above code didn't work and it just closed my activity and loaded the previous activity.
I then searched the forum and found some code that Erel posted:
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
Select KeyCode
Case KeyCodes.KEYCODE_BACK
Return True
End Select
Return False
End Sub
However I did notice that Erel posted 'I see it too. This will be fixed in the next update.' however I am not sure if I have done something wrong in my code or if this hasn't been fixed in v3.00 (as this is the version I am using)?
http://www.b4x.com/android/forum/threads/android-4-3-pb-with-closing-the-app.31328/
I have the same issue on Android my Samsung Galaxy S2 (running Android 2.3.6) and on my Sony Xperia Z (running Android 4.2.2).
However to get past this issue I had to use the code above (2nd lot of code above) to fix this issue.
Through I would share this in case someone else gets the same issue. (unless I am doing something wrong and the 1st lot of code shouldn't of worked?)