I am developing an android app and I want it to do a particular action(say for example, go to a particular URL) when the user loads it for ‘N’ times. How do I go about doing it. I know its got to do with SharedPrefs and Activity LifeCycle but I am not being able to get a headstart into it. Can someone plz suggest how to proceed.
Share
Use the onCreate method in your activity to set a counter in SharedPrefs. Increase it by 1 each time and when it reaches N, do your thing..
}