0

I'm trying to create something for the Android app using Compose and navigation, to make it possible to continue with the last screen I was showing to the user if an app crashed or been killed by the user.

I was searching for a solution on Google, and I found the way with sharedPreferences but I think it wouldn't help me, is there any other way to do that?

  • 2
    You need something that will be able to "remember" that the app was killed, so shared preferences or holding it in a file of some sort would be (as I'm aware) your only option – JustSightseeing Apr 10 '23 at 09:03
  • 1
    i was wondering , in my case , each of the screens have their own viewmodels , so if i just save in shared preferences some value every-time i enter each of that screens , but then to handle that option would be some tricky , because i have too much screens , that's why i'm asking , maybe there is some better options to handle that – Daviti Gogochishvili Apr 11 '23 at 09:04
  • but anyways thank you ! – Daviti Gogochishvili Apr 11 '23 at 10:53
  • Unfortunately, I think that's the only way, saving and reading from the shared preferences isn't really costly nor time consuming, so it should work fine (I believe) – JustSightseeing Apr 11 '23 at 11:02
  • thank you very much , i've started implementing this – Daviti Gogochishvili Apr 11 '23 at 11:06
  • now i have problems with navigation and back button , when i continue with the screen i last used , back button doesnot work .... – Daviti Gogochishvili Apr 14 '23 at 09:33

0 Answers0