سؤال

I'm building an android app but i get crashes when i rotate dialogs because i've not implemented the SaveInstanceState(). To save and restore simple objects like strings and primitives seems pritty straight forward. But I would also like to save some more complex objects like Context, AttributSet and some listeners? How do I handle that? To me they do not really seem to fit in a Bundle. Help would be much appreciated :)

هل كانت مفيدة؟

المحلول

Try this way

<activity
            android:name="yourActivityInwhichCallingDialog"
            android:configChanges="keyboardHidden|orientation|screenSize"
 />
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top