Retain context menues and dialogs on rotation

This commit is contained in:
Martin Fietz 2016-06-20 16:30:18 +02:00
parent b7dfea13b0
commit a7a9a11f7b
2 changed files with 8 additions and 6 deletions

View File

@ -43,7 +43,7 @@
<activity <activity
android:name=".activity.MainActivity" android:name=".activity.MainActivity"
android:configChanges="keyboardHidden|orientation" android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTask" android:launchMode="singleTask"
android:label="@string/app_name"> android:label="@string/app_name">
<intent-filter> <intent-filter>
@ -81,7 +81,7 @@
<activity <activity
android:name=".activity.PreferenceActivityGingerbread" android:name=".activity.PreferenceActivityGingerbread"
android:configChanges="keyboardHidden|orientation" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/settings_label"> android:label="@string/settings_label">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -90,7 +90,7 @@
<activity <activity
android:name=".activity.PreferenceActivity" android:name=".activity.PreferenceActivity"
android:configChanges="keyboardHidden|orientation" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/settings_label"> android:label="@string/settings_label">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -146,6 +146,7 @@
</activity> </activity>
<activity <activity
android:name=".activity.AboutActivity" android:name=".activity.AboutActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/about_pref"> android:label="@string/about_pref">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
@ -160,12 +161,12 @@
</activity> </activity>
<activity <activity
android:name=".activity.OpmlImportFromPathActivity" android:name=".activity.OpmlImportFromPathActivity"
android:configChanges="keyboardHidden|orientation" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/opml_import_label"> android:label="@string/opml_import_label">
</activity> </activity>
<activity <activity
android:name=".activity.OpmlImportFromIntentActivity" android:name=".activity.OpmlImportFromIntentActivity"
android:configChanges="keyboardHidden|orientation" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/opml_import_label"> android:label="@string/opml_import_label">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW"/> <action android:name="android.intent.action.VIEW"/>
@ -217,7 +218,7 @@
<activity <activity
android:name=".activity.OnlineFeedViewActivity" android:name=".activity.OnlineFeedViewActivity"
android:configChanges="orientation" android:configChanges="orientation|screenSize"
android:label="@string/add_feed_label"> android:label="@string/add_feed_label">
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"

View File

@ -103,6 +103,7 @@ public class PreferenceActivity extends AppCompatActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setRetainInstance(true);
addPreferencesFromResource(R.xml.preferences); addPreferencesFromResource(R.xml.preferences);
PreferenceActivity activity = instance.get(); PreferenceActivity activity = instance.get();
if(activity != null && activity.preferenceController != null) { if(activity != null && activity.preferenceController != null) {