javaandroidyandex-maps

Weird bug - the application is stuck, but the UI still responds


So.. I have a really strange bug in my application.
At some point, for some reason, application stops handling some events, for example: adapters wont update after notifydatasetchanged call, mapview is not responding at all, activities wont start, any kind of fragments transaction does nothing - list goes on.

But at the same time, if I'll press some button - it displays ripple effect and fires onClick (and even network request started by this click finishes successfully), this means that main thread still works correctly.
I am able to hide and show views programmatically, receive firebase realtime db events and do all kind of business logic.

My wild guess is that either some thread responsible for this kind of stuff stuck (deadlock?), or maybe this is how application works after OutOfMemoryException? Because this usually happens after working with map a lot (Yandex Map).

I really don't understand whats going on.


Solution

  • I figured it out. This weird behaviour was due to a lot work with UI elements from one background thread. I don't know why and how project was still working, but thats the case. Something breaks after N calls to UI from non-UI threads.
    Also, on Android 8 it breaks right away, but on lower api levels application can work for hours before breaking.