title: Android | How to add an integer in SharedPreferences and prevent it from returning to zero
body: <p>I want to add an integer and store it to SharedPreferences. First, I instantiate it to zero then, when the button is clicked, I want to add 1 to it and save it on SharedPreferences. However, it goes back to zero when the activity is recreated due to the instantiating step. How should I do it?</p>