S Scantech Well-Known Member Licensed User Longtime User Jun 29, 2025 #1 I know it is a bit early for api 36, but i had to mention this problem. SDK = 36 (android-36) targetSdkVersion= 36 The following event is broken in API 36. It crashes when adding the event below and pressing back key. It does not report any errors at the log, just crashes. It is ok without the event, no crashes. B4X: Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event End Sub I tested it with emulator (Android 16) and i do not have an actual device with Android 16 to test it. I hope its only in the emulator. Maybe someone can test it with a real device with Android 16. Attachments Keypress.zip Keypress.zip 10.2 KB · Views: 306 Last edited: Jun 29, 2025
I know it is a bit early for api 36, but i had to mention this problem. SDK = 36 (android-36) targetSdkVersion= 36 The following event is broken in API 36. It crashes when adding the event below and pressing back key. It does not report any errors at the log, just crashes. It is ok without the event, no crashes. B4X: Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event End Sub I tested it with emulator (Android 16) and i do not have an actual device with Android 16 to test it. I hope its only in the emulator. Maybe someone can test it with a real device with Android 16.
DonManfred Expert Licensed User Longtime User Jun 29, 2025 #2 When it crashes thjen there MUST be an error in the LOG. Maybe in the unfiltered LOG. Find it and post it. PD: The recommended SDK is not 36 Last edited: Jun 29, 2025 Upvote 0
When it crashes thjen there MUST be an error in the LOG. Maybe in the unfiltered LOG. Find it and post it. PD: The recommended SDK is not 36
S Scantech Well-Known Member Licensed User Longtime User Jun 29, 2025 #3 My old laptop can't keep up with polling and causing freeze issues. I crashed the app and exit the emulator. The log posted. Attachments log.txt log.txt 320.3 KB · Views: 307 Upvote 0
My old laptop can't keep up with polling and causing freeze issues. I crashed the app and exit the emulator. The log posted.
DonManfred Expert Licensed User Longtime User Jun 29, 2025 #4 Scantech said: 'return true if you want to consume the event Click to expand... in fact you need to return true or false in this sub. you can just remove the sub if you don´t use it. Upvote 0
Scantech said: 'return true if you want to consume the event Click to expand... in fact you need to return true or false in this sub. you can just remove the sub if you don´t use it.
S Scantech Well-Known Member Licensed User Longtime User Jun 29, 2025 #5 DonManfred said: in fact you need to return true or false in this sub. you can just remove the sub if you don´t use it. Click to expand... It crashes with return false. I forgot to add it. Last edited: Jun 29, 2025 Upvote 0
DonManfred said: in fact you need to return true or false in this sub. you can just remove the sub if you don´t use it. Click to expand... It crashes with return false. I forgot to add it.
Sagenut Expert Licensed User Longtime User Jun 29, 2025 #6 I tried and I get no crashes, using and Android 36 emulator. The app never crashes but sometimes it's sent to background, probably because the KeyBack is catched by the OS as it is not consumed by the app. Anyway I would not spent too much time with something that maybe request a B4A update for some changes in Android 36 and that now it's not requested. Upvote 0
I tried and I get no crashes, using and Android 36 emulator. The app never crashes but sometimes it's sent to background, probably because the KeyBack is catched by the OS as it is not consumed by the app. Anyway I would not spent too much time with something that maybe request a B4A update for some changes in Android 36 and that now it's not requested.
teddybear Well-Known Member Licensed User Jun 29, 2025 #7 I tested it in emulator, no crash. even if there is no return value in sub keypress. Try reinstalling the emulator. B4X: Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event Dim ph As Phone Log(ph.SdkVersion) Log("key="&KeyCode) Return False End Sub Upvote 0
I tested it in emulator, no crash. even if there is no return value in sub keypress. Try reinstalling the emulator. B4X: Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event Dim ph As Phone Log(ph.SdkVersion) Log("key="&KeyCode) Return False End Sub
Sagenut Expert Licensed User Longtime User Jun 29, 2025 #8 @teddybear I wonder why you get a keycode=67 when the KeyBack should be 4, if I am correct. Upvote 0
teddybear Well-Known Member Licensed User Jun 29, 2025 #9 I pressed the key backspace on keyborad. Keycode 4 is ESC on my pc, there is also no crash Last edited: Jun 29, 2025 Upvote 0