New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rotation bug at loading #52
Comments
Thanks, just reproduced. Just a question, what phone/config are you using that you have such long load times? |
i9300 with archidroid experimental lollipop. Loading all settings takes about 2.5 ~ 3 seconds. |
Ah OK, the S3 is an older device. 3s sounds fine for that CPU. |
yeah. I'm waiting for the nexus 5 2015 to upgrade, but for now it is a adequate device with adequate CPU. The bug is not even that annoying now i know it. I rotated my device by accident and it crashed. |
I had this bug when my RAM was overloaded with apps. Logcat is obscure, but it seems that ART itself bugs.
I think the problem is that when rotation happens, Fragments haven't been fully loaded, and ActionBarDrawerToggle is having some sort of bug with instant new configuration. Maybe saving each fragment data by using Fragments setRetainInstanceState method and Activity's onSaveInstanceState and onRestoreInstanceState and reloading that data when onCreate is called after orientation change will fix the problem. If user has some big JSON config file, then memory requirements for such Fragment data saving would be big and slow the application. One of workarounds would be to lock orientation while all Fragments are loaded, and then unlock it via setRequestedOrientation method. I'll explore this solution when I have time. |
…ivity Fixes AndreiLux#52 Logcat showed that error happened while invoking onConfigurationChanged method in mDrawerToggle, but didn't provide crash info. Forcing portrait layout until all fragments have been loaded fixes rotation bug on loading app. setRequestedOrientation will block invoking onConfigurationChanged for orientation events, but screenSize changes when orientation is changed will invoke it, thus avoiding this bug and properly notifying mDrawerToggle.
Commit: 464d92f fixed issue AndreiLux#52 That commit also made new bug (or rather exposed what was happening in AndreiLux#52). On each rotation, Settings was unable to instantiate MyPreferenceFragment. Each time rotation changed while user was in settings menu, Synapse would crash due to InstantiationException Fix this by moving MyPreferenceFragment out of Settings and making it outer standalone class.
This bug is easy to reproduce. Open synapse, and rotate the device while the settings are loading (spinner is still going). The app will force close. Rotation works fine when the settings are loaded.
Very minor bug, and i only saw it by accident.
The text was updated successfully, but these errors were encountered: