I am using static session_counter to store the data,
yes the data I want to retrieve when app is opened is a INTEGER
private static int session_counter = 0;
AFTER USER PERFORMED AN ACTION THE SESSION COUNTER SHOWS 1,
BUT WHEN THE APPLICATION IS CLOSED AND RE-OPENED AGAIN THE COUNTER IS SET TO 0
I WANT THAT SESSION COUNTER TO BE THE SAME AS PREVIOUS STATE TILL THE SPECIFIC CONDITION IS MET
2
Answers
You might want to use shared-preferences to save your value. This answer might be useful
For applications such as this you need a way where you can persist the data between each session.
as a previous answer mentioned shared preferences is the most effective way to do it.
Other alternatives exist as
The structure will be somewhat like this
In your case it will be like