“app last state when closed”

Hello, I am David. I need help with my app that I am creating. My app has a button that, when clicked, activates an “on” image. I would like the app to remember this state when it is closed and reopened, so it opens with the “on” image. Can you help me with this? Thank you

just store that value in variable and store it to tiny db. Then fetch the tags on screen initializa and check the tag value.

See here for something similar

hola de nuevo gracias por las respuesta pero me trae de cabeza la cuestión es que esta app es para conectar por el móvil a través de bluethoo una central de potencia he creado 4 botones que cada uno define un mapa de potencia la comunicación esta echa con esp32 y el móvil en el código del esp32 guarda perfectamente el ultimo mapa perfectamente pero la app cuando la enciendo se queda sin activar el mapa cuando se cerro la app e ahi donde quiero llegar