AndreiLux / Synapse

Please read the introduction to create a working backend:
https://github.com/AndreiLux/Synapse/wiki
Other
38 stars 22 forks source link

Fix for issue 52 #60

Open duki994 opened 7 years ago

duki994 commented 7 years ago

Fixes #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.

Forcing orientation made (or rather exposed what was happening in #52 ) new bug. Each time user rotated screen while in settings menu, Synapse would crash with InstantiationException for MyPreferenceFragment.

I fixed this by moving MyPreferenceFragment class to separate file and passing settings activity context via variable Utils.settingsActivity.

This effectively fixed all bugs I have noticed related to #52