Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Trying to access settings while onboarding triggers crash #1371

@msfjarvis

Description

@msfjarvis

Tapping Settings on the first onboarding screen (the one with the Let's go button) triggers the following crash:

java.lang.RuntimeException: Unable to start activity ComponentInfo{dev.msfjarvis.aps.debug/dev.msfjarvis.aps.ui.settings.SettingsActivity}: java.lang.IllegalStateException: Setting the checked value before the preference was attached isn't supported. Consider using `defaultValue` instead.
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
	at android.app.ActivityThread.-wrap11(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:164)
	at android.app.ActivityThread.main(ActivityThread.java:6494)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Setting the checked value before the preference was attached isn't supported. Consider using `defaultValue` instead.
	at de.Maxr1998.modernpreferences.preferences.TwoStatePreference.setChecked(TwoStatePreference.kt:30)
	at dev.msfjarvis.aps.ui.settings.GeneralSettings.provideSettings(GeneralSettings.kt:69)
	at dev.msfjarvis.aps.ui.settings.SettingsActivity.onCreate(SettingsActivity.kt:38)
	at android.app.Activity.performCreate(Activity.java:7009)
	at android.app.Activity.performCreate(Activity.java:7000)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
	... 9 more

Originally posted in #1370 (comment)

Metadata

Metadata

Assignees

Labels

A-UI-UXArea: General UI/UX concernsC-bugCategory: This is a bugE-easyEffort: Should be easy to implement and would make a good first PRP-highPriority: high, must be resolved before next major release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions