CodenameOne
CodenameOne copied to clipboard
App crash when returning from background if Dialog permission was showing in android side
if I request Dialog permission and next go to background and it return again the dialog is showed perfectly by if you repeat the same step again my app crash ang ANR is showed in android 10.
2021-09-16 16:52:16.837 1151-1151/? E/Layer: [Surface(name=AppWindowToken{3fb193 token=Token{ad5a682 ActivityRecord{28dadcd u0 com.geotracksolutionsint.forcesos/.ForceSOSStub t95737}}})/@0xd5f1df5 - animation-leash#0] No local sync point found
check this log in real device.
the methods star() , stop() doesn't fire if the Permission dialg is showed in fron of my app.

@shannah this issue was solved with this committ? https://github.com/codenameone/CodenameOne/commit/09a9c130390fef21f35ff57d1ad4c69ad2e9753e
this committ is available today in this moment?
@shai-almog please help me to check if this committ solved the issue in android side and if this committ is applied in the built server.
Please check the video about the behavior of your stub in the android side. As I describe up. When I go to background with the native dialog permission in front of my app many times. The focus of my app goes to black and next crashed. I put some log in your generate code by built server and I check that you have a synchronized code that when my app fail it keep waiting. Could you tell me why ?(see the video)

I test in android 10 and 11. in 10 fail like the video and with the 11 don't fail at the moment
Why some times if I have the native permission dialog in from of my app an I go to background. The method star() if fire instead of stop()?
I fix the problem ignoring this event that you generate when may app goes to backgrond.
I don't Know why you are sending this event if the app goes to backgrond
@shannah that related with this committ https://github.com/DurankGts/CodenameOne/commit/16ae9b8f59f08f9700bb5177dd66309c5f03b429
?
No. Not related
do you check the video up about this issue?
I fix the problem ignoring this event that you generate when may app goes to backgrond.
@DurankGts Could you please describe more specifically how you resolved it? Thank you.

this the way that I found correctly. I don't know why the build generated code in this specific case it send and start event to my app when I go to background.
@plumberg do you have the same issue?
@DurankGts Yes, I noticed that in Android 11 everything works fine. But in Android 10 when you reopen it from a background the app just didn't load the form (at least it happened few times. Now it works).
When I debugged the behavior in Android Studio, I noticed that when you put the app in the background, sometimes it calls only stop() method, sometimes start() and stop() methods simultaneously.
I wasn't able to debug the case when the app just doesn't load the form yet.