0

I have a custom ListPreference that uses an AsyncTask and ProcessDialog. Works great, until I rotate my phone... Here is one possibility to solve this problem, but it requires access to onStop() which only Activities have, but not the ListPreference. So I am wondering: Is there something like this in the ListPreference / Preference class? How to detect Screen rotation from a Preference? Thank you very much!

Community
  • 1
  • 1
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270

1 Answers1

0

Easiest way to deal with this will be to change the manifest for your PreferenceActivity subclass:

<activity android:name=".MyPrefs" android:configChanges="orientation|keyboardHidden"
            android:label="Preferences" />

This will prevent your activity from being recreated when you change the screen orientation as well as when the OSD keyboard appears.

Thomas Dignan
  • 7,052
  • 3
  • 40
  • 48