Page 1 of 1

Native activity ANR when system dialog shown. 1.9 RC1

Posted: Tue Aug 27, 2013 3:34 pm
by diamondcm
Hi all,

This is really tough, hard to find the problem.

I am using 1.9 RC1 to build my project. Everything goes so well except System UI dialog shown. For example, I call "quit or cancel" UI dialog when users press the return button. The UI is shown pretty good. But after about 5 seconds, the whole game ANR! This anr appears not only in this case. If I make JNI calls to show third-party payment UI, after 5 seconds, the game ANR also!
So do I miss any configuration about native activity to avoid this ANR? Or any thread operation is needed when calling main-thread UI of android? Or is there anything I missed when ogre rendering frame and android UI both shown?
Thank you all so much. This problem make me crazy for more than 1 month.

Re: Native activity ANR when system dialog shown. 1.9 RC1

Posted: Fri Sep 06, 2013 12:35 pm
by mmixLinus

If you do a blocking call in the Main thread (UI thread), and the Main thread is sent a UI event (for example a key press (touch the screen)) you will get an ANR if you don't handle the UI event within 5 seconds. It seems your Main thread stops handling events when you show the popup. So either your popup is modal and opened in the main thread or your main thread event loop is getting stuck for some other reason. You need to reply to all events within 5 seconds!

Android ANRs