Question

I'm integrating with Mixpanel, which lets you track arbitrary events for your app. I want to track how often the Android app is opened.

Is there a central place where I can put code that runs every time the app is opened, regardless of activity?

Was it helpful?

Solution

You can track if it was started from the launcher by tracking Intent parameters in your Main Activity. Or if you want to track how many times this screen was started, u could put your tracking code inside onStart of your activity.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top