Android Question fatal signal error Android 4.3 KeyCodes.KEYCODE_MENU

virpalacios

Active Member
Licensed User
Longtime User
Hi At All, :D

After I received an upgrade for my Samsung S4 for Android 4.3 my App start crashing, i got troubles in
my Activity_KeyPress(KeyCode As Int) Routine, After i execute the code I got
the message AppName Stopped and in log file I got o_O
Fatal signal 11 (SIGSEGV) at 0x0089897d (code=1), thread 19740 (Mobile.computing). I read the same Issue for KEYCODE_BACK and Erel summitted an temporary fix, however I am using version 3.0 and got this issue.

These are my Routines (Phone Samsung S4 with Android 4.3 and B4A 3.00) :(
' The complete source code is loaded in thread

Sub Activity_KeyPress(KeyCode As Int) As Boolean
Dim options_list As List
Dim Answ As Int

options_list.Initialize
options_list.AddAll(Array As String("Search Customers"))

If KeyCode = KeyCodes.KEYCODE_MENU Then
Answ = InputList(options_list,"Options",-1)
Select Case Answ
Case 0
mnu_search_customers
End Select
End If

Return True
End Sub

Sub mnu_search_customers
Msgbox("Customers Searched","Message")
End Sub


' This is very simple it just show a menu and send a message inside a routine, also i include the complete source file in .zip format.
'End of routines

I appreciate any help with this issue, and thanks in advance for your help

Best Regards

Virpalacios
 

Attachments

  • crash43.zip
    1.2 KB · Views: 269

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use [ code ] [ /code ] tags (without spaces) when posting code.

You will need to use the same workaround:
B4X:
Sub Activity_KeyPress(KeyCode As Int) As Boolean
   If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
     CallSubDelayed(Me, "HandleKeyPress")
   End If
   Return True
End Sub
Sub HandleKeyPress
   Dim options_list As List
   Dim Answ As Int
   options_list.Initialize
   options_list.AddAll(Array As String("Search Customers"))
   Answ = InputList(options_list,"Options",-1)
   Select Case Answ
     Case 0
       Log(0)
         mnu_search_customers
       Log(2)
   End Select
End Sub

Starting from Android 4.3 it is not possible to show a modal dialog in this event. In v3.00 the workaround is applied automatically to the back key handling. However it is not possible to apply it automatically in the general case. I will add a note about this in the documentation.
 
Upvote 0

virpalacios

Active Member
Licensed User
Longtime User
Thanks Erel for your promptly anwswer I will check my code and adjust for Android 4.3

Best Regards

Virpalacios :)
 
Upvote 0
Top