Added workaround for PreferenceScreen bug
http://code.google.com/p/android/issues/detail?id=4611
This commit is contained in:
parent
0da8b0acc9
commit
ab6b4a4e3b
|
@ -157,15 +157,16 @@ public class PreferenceActivity extends SherlockPreferenceActivity {
|
|||
return true;
|
||||
}
|
||||
});
|
||||
findPreference(UserPreferences.PREF_ENABLE_AUTODL).setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
checkItemVisibility();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
findPreference(UserPreferences.PREF_ENABLE_AUTODL)
|
||||
.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
checkItemVisibility();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
buildAutodownloadSelectedNetworsPreference();
|
||||
setSelectedNetworksEnabled(UserPreferences
|
||||
.isEnableAutodownloadWifiFilter());
|
||||
|
@ -330,4 +331,23 @@ public class PreferenceActivity extends SherlockPreferenceActivity {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
|
||||
Preference preference) {
|
||||
super.onPreferenceTreeClick(preferenceScreen, preference);
|
||||
if (preference != null)
|
||||
if (preference instanceof PreferenceScreen)
|
||||
if (((PreferenceScreen) preference).getDialog() != null)
|
||||
((PreferenceScreen) preference)
|
||||
.getDialog()
|
||||
.getWindow()
|
||||
.getDecorView()
|
||||
.setBackgroundDrawable(
|
||||
this.getWindow().getDecorView()
|
||||
.getBackground().getConstantState()
|
||||
.newDrawable());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue