How can a button on android Change state available and busy and have memory?
Example if I leave the application or if I use it in the background when I return to the main screen, remember its status.
How can a button on android Change state available and busy and have memory?
Example if I leave the application or if I use it in the background when I return to the main screen, remember its status.
If you exit completely from the application completely and you want your application to keep your status, this is not possible naturally you have to implement in which Activity you want to start after closing the application, since when the application is closed, it is completely destroyed .
In the case of having it in the background and when it returns to the main screen it returns to its state, this can happen normally but you would have to implement a data recovery in case of not finding any value since the operating system could reclaim memory and eliminate the values stored in static variables, and in an extreme case the whole process, which would be similar to closing the application completely.
To implement that your application retains its status you would have to make use of data storage preferences or database.