Bug? Android 4.3 pb with closing the app

luke2012

Well-Known Member
Licensed User
Longtime User
Thanks for the workaround!
It works also on Ginger, ICS and JB < 4.3?
 

psdos

Active Member
Licensed User
Longtime User
Had the same problem on Nexus 7 2013 Edition with android 4.3. No Problem in Note 2, Acer A500, Note 10.1, Ace 2, S3 Mini, S2, ...

My error is "Fatal signal 11 (SIGSEGV) at 0x00770065 (code=1), thread 1195", and application crash.

Thanks you Erel. The workaround works perfectly!
 

rworner

Member
Licensed User
Longtime User
Can you upload an example that demonstrates the issue?

Erel,

Same problem, but even after adding your fix. The test uses a webview to load yahoo.com. Next it loads google.com

After the google site appears pressing the back button is intended to take you back to yahoo,
but I get the Return True error.
 

Attachments

  • rwbacktst.zip
    93.8 KB · Views: 319

rworner

Member
Licensed User
Longtime User
The signature of KeyPress should be (see the warning messages in this sub):
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean
Sorry - I should have cut and pasted the code, but typed it in manually instead. It is working fine.
 

mcmanu

Active Member
Licensed User
Longtime User
Erel could you please help me
When i Press the volume Button my app Chrashes with the Posted error

my code is:

If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
Dim PhoneVol As Phone
Dim temp As Int
temp = PhoneVol .GetVolume(PhoneVol .VOLUME_MUSIC)
If temp > 0 Then
temp = temp - 1
PhoneVol .SetVolume(PhoneVol .VOLUME_MUSIC, temp, True)
End If
End If

If KeyCode = KeyCodes.KEYCODE_VOLUME_UP Then
temp = PhoneVol .GetVolume(PhoneVol .VOLUME_MUSIC)
If temp < PhoneVol .GetMaxVolume(PhoneVol .VOLUME_MUSIC) Then
temp = temp + 1
PhoneVol .SetVolume(PhoneVol .VOLUME_MUSIC, temp, True)
End If
End If

My other Problem is that i Use the Back key not only to close my application
For example i Set some Views/controls to Visible false when i press the backkey (when the views are visible true --> back key --> views visible false)
 
Last edited:

priitp

Member
Licensed User
Longtime User
Erel,

Is this issue solved with Basic4Android ver 3.50?
Or must we convert all subroutine calls to CallSubDelayed?

Having issues with Samsung SIII Android 4.3
Almost all keypresses result to "Fatal signal 11 (SIGSEGV)"

Thanks
Priit Poldmaa
 

priitp

Member
Licensed User
Longtime User
It happens when I process keypress from menu item
(Activity_KeyPress -> CaseKeyCodes.KEYCODE_MENU).

There I call subroutines what are itself event handlers (button_click).
Inside thoose event handlers I do StartActivity(anotherActivity).

Looks like not modal dialogs for me.

Regards
Priit
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Note that a DoEvents call will also trigger this issue.

I've tested it on a device without a menu button so I wasn't able to catch the menu key (remember that many devices don't have a menu button). I've tried it with this code:
B4X:
Sub Activity_Create(FirstTime As Boolean)

End Sub

Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
   If KeyCode = KeyCodes.KEYCODE_VOLUME_DOWN Then
     StartActivity(a1)
   End If
End Sub
It didn't raise any error.

Please try it and change it to the menu button and see whether it works or not.
 

priitp

Member
Licensed User
Longtime User
Unfortunatelly a guy with the phone to test with left
and I'm not able to test this for some days.

Just in case Erel you have a bit of spare time I sent the project to you privatelly.

Thanks
Priit
 
Top