Possible Duplicate:
How to know my Android application has been upgraded in order to reset an alarm?
I need to run a certain code when my android app is only updated (I specifically want to reschedule alarms).
The did an extensive search on SO and I found that people suggest using SharedPreferences. I dont think this would be correct as sharedPreferences can be deleted upon restart or by simply clearing the cache. Which means when my app is updated, shared preferences may not exist and I may not know if it is an update or simply fresh install ( or even worse a restart).
So, Is there any other way? Perhaps some sort of intent or some sort of method that executes (kinda like onUpgrade for sqlite).
Please advise . Thank you so much