Fix addPreferencesFromResource() override
@@ -205,18 +205,15 @@ public abstract class SettingsFragment extends PreferenceFragment implements Pre
@SuppressWarnings("JavaReflectionMemberAccess")
@Override
public void addPreferencesFromResource(@XmlRes int preferencesResId) {
+ if(!(this instanceof AboutFragment)) {
try {
Context context = U.wrapContext(getActivity().getApplicationContext());
- PreferenceScreen screen = (PreferenceScreen) Class.forName("android.preference.PreferenceManager")
+ Class.forName("android.preference.PreferenceManager")
.getMethod("inflateFromResource", Context.class, int.class, PreferenceScreen.class)
.invoke(getPreferenceManager(), context, preferencesResId, getPreferenceScreen());
+ } catch (Exception e) { /* Gracefully fail */ }
+ }
- if(!(this instanceof AboutFragment))
- screen.getDialog().getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
-
- setPreferenceScreen(screen);
- } catch (Exception e) {
super.addPreferencesFromResource(preferencesResId);
}
}
\ No newline at end of file
-}
\ No newline at end of file
