I'm new to kotlin and android app developpement in general and I want to make a Quiz app with jetpack compose not XML, and this app has multiple levels and when the user starts the quiz if he decides to stop playing in a certain level and quit the app i want to save that level so next time when he come back to play he's gonna start from the same level he stopped. I've tried to use preference datastore but it doesn't seem to work. this is my Datastore class:
this is how I store the current level: save current lvl
this is how I get the lvl I stored in the datastore: get stored lvl
if you have any idea what I'm doing wrong please and if posibile use jetpack compose. thank you.
