I want to detect each time the user opens the app, by tap on home / desktop icon. There seem not to be a straight forward way to do it. Found a few workarounds but nothing seems to be really reliable.
Things like, extend application object and use method "onCreate()", but this is not what I need because it's not called always when the user taps on the app's icon (can be just brought from the background, launching doesn't necessarily recreate the application), and also the application may be destroyed and recreated while running. Then Application.onCreate() will also be called.
There war also some approaches involving BroadcastReceiver and checking intent flags but everything seems to be also not quite reliable?
I need this because I want to track with Google Analytics, when the user opens the app.
Thanks