I'm trying to integrate Google Analytics into my Android project using the information on the website of the respective SDK. However, there is very little documentation available. My project has 6 different Activities and I noticed that using the method on the website results in a unique visit in Google Analytics for each Activity that is being opened, even if it's still in the same session. Apparently, Google Analytics for Android never reuses a previously used session.
Their method is to start tracking activity in onCreate and then stop tracking in onDestroy. The problem I have with this is that a session will stay active if a user presses the home button instead of the back button, since the Activity will not be destroyed. Therefore I chose to do it in onResume and onPause instead but that means that new sessions gets opened when a new Activity is opened.
Does anyone know any way to really track a single session over multiple Activities?