Zoltan Demant
10/24/2023, 7:55 AMBitmap
) for longer than the usual remember
, but without using rememberSaveable
? Im basically putting my screen in the backstack for a few moments, and upon return Id still like to be able to access the bitmap! At the same time, I dont want to cache it in a variable outside of composition 💀Zoltan Demant
10/24/2023, 8:06 AMAlex
10/24/2023, 8:10 AMViewModel
but you could also create your own remember
which stores the bitmap in the nonconfigurationinstance
Alex
10/24/2023, 8:11 AMZoltan Demant
10/24/2023, 8:17 AMremember
that stores it in nonconfigurationinstance
?
About storing it outside of composition -> I would have no way of knowing when to dispose itZoltan Demant
10/24/2023, 8:18 AMPablichjenkov
10/24/2023, 8:28 AMZoltan Demant
10/24/2023, 8:38 AMZoltan Demant
10/24/2023, 8:39 AMPablichjenkov
10/24/2023, 9:00 AMZoltan Demant
10/24/2023, 9:03 AMrememberSaveable
(I forgot that Bitmap was Parcelable). Not sure if its the best solution, but Im glad the Bitmap goes away when the composable does. If anyone has any better solution still, Id love to hear it!yschimke
10/24/2023, 11:04 AMZoltan Demant
10/24/2023, 11:22 AMAlex
10/24/2023, 11:42 AMAlex
10/24/2023, 11:44 AMAlex
10/24/2023, 11:44 AMZoltan Demant
10/24/2023, 11:46 AMAlex
10/24/2023, 11:54 AMyschimke
10/24/2023, 12:22 PMZoltan Demant
10/24/2023, 12:53 PMZoltan Demant
10/24/2023, 12:55 PMZoltan Demant
10/24/2023, 3:09 PMrememberSaveable
is the closest to a proper solution, but as others have mentioned; it will likely cause issues due to the size of the bitmaps.Zoltan Demant
10/25/2023, 5:03 AM