Closed phillwiggins closed 6 years ago
Check the logcat, you'll probably see a caught exception there (it's getting caught in the PreferenceFragmentCompat
's onCreate(...)
as of now but I'll remove the try...catch
block).
Ahh yes, I missed this somehow, I'm getting:-
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter rootKey 12-05 19:31:53.816 10344-10344/ W/System.err: at FragmentSettings.onCreatePreferencesFix(FragmentSettings.kt:0)
The rootKey
param is not annotated with @NonNull
, so it can be null. You should update your implementation so that it is reflected (mind the ?
after String
in the params):
override fun onCreatePreferencesFix(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences, rootKey)
// additional setup
}
Did it solve your problem?
Apologies for the late response. Yes. My issue was unrelated and was the mutable variable issue.
On 10 Dec 2017 12:37, "Gergely Kőrössy" notifications@github.com wrote:
Did it solve your problem?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Gericop/Android-Support-Preference-V7-Fix/issues/128#issuecomment-350545422, or mute the thread https://github.com/notifications/unsubscribe-auth/AHgn3vtjMQku37OWd-2dPX0MB4ewcrD6ks5s-9CdgaJpZM4Q2wyW .
For some reason I being shown a blank preferences screen.
The fragment is loading correctly as I can set the background programatically to a different colour, however, nothing else is shown.
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">