blinskey / greek-reference

An ancient Greek lexicon and grammar for Android.
https://play.google.com/store/apps/details?id=com.benlinskey.greekreference
Apache License 2.0
29 stars 5 forks source link

Fix a crash when rotating screen #144

Closed blinskey closed 9 years ago

blinskey commented 9 years ago

Fixes #142. It looks like getActivity() was sometimes returning null on screen rotation because the parent activity had been destroyed and not yet recreated. We now save a reference to the activity in onAttach(). Unfortunately I can't reproduce this bug, so I can't verify with certainty that this will fix it, but I think this will do the trick.