You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Caused by: java.lang.RuntimeException: This should be called after super.onCreate.
at android.preference.PreferenceActivity.requirePreferenceManager(PreferenceActivity.java:1439)
at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1511)
at package.name.SettingsActivity_.init_(SettingsActivity_.java:38)
at package.name.SettingsActivity_.onCreate(SettingsActivity_.java:32)
at android.app.Activity.performCreate(Activity.java:5990)
I guess the problem is in the generated class:
@OverridepublicvoidonCreate(BundlesavedInstanceState) {
OnViewChangedNotifierpreviousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_);
init_(savedInstanceState); // that line should be after onCreate (line 32)super.onCreate(savedInstanceState);
OnViewChangedNotifier.replaceNotifier(previousNotifier);
}
privatevoidinit_(BundlesavedInstanceState) {
addPreferencesFromResource(xml.preferences); // line 38
}
Is there anyone who can confirm the bug or indicate my mistake (I did everything as in the wiki section, so I think all should be fine)
Cheers!
This is a bug unfortunately. Actually we have a running test for this which passes, but it seems Robolectric have a different implementation than real Android code...
This should be fixed. Nonetheless i also encourage the usage of PreferenceFragment, because this way is deprecated (and also PreferenceFragment are working now with AA 😄 ).
I do not know why, but the Android folks still not provide a backport of PreferenceFragment in the support library. The good news is that there is an unofficial version if it. Bad news is: we do not support the android.support.v4.preference.PreferenceFragment class... But i think we should (which also adds a forward support of the official one if Google releases it). Please open a new issue for that.
@yDelouis@dodgex there are three issues raised about our new preference API today. Fixing these is easy fortunately. Should we create a hotfix release? Maybe it makes sense, because the next big release will be 4.0 with breaking changes.
Hi,
I've tried to implement the preference screen in my app today and stumbled upon this bug (or am I doing something wrong?)
I have created a xml file with preferences, and annotated the activity :
and it gives me the error:
I guess the problem is in the generated class:
Is there anyone who can confirm the bug or indicate my mistake (I did everything as in the wiki section, so I think all should be fine)
Cheers!