How to save the condition of the screen

how to save the condition of the screen, so I want to save the condition where when I exit the application the condition will still be stored and running

Please give me an example, thank you.

Use Tiny DB to store
What you want to store ?

I want to keep the conditions on the screen to keep alive.

Sorry But I Didn’t Understand

Can you explain in details

Do you mean you don’t wanna to close the screen?

I want to save this condition if I exit the screen the connection will still connected

Use on app pause

Thanks for the response, can you give me an example.

Okay
What Type Of app is this ?
Notes App

iot control

Why don’t you store the key status
(When key switched changed) into a tinydb as true or false ?

Next time while open the same read the status of tinydb and set the value according to


well, that’s right but I’m still at a loss to add it to my block