I am implementing Analytics in my android application, and I would like advice on when to call super.onPause()
if (mAnalyticsSession != null) {
mAnalyticsSession.close();
mAnalyticsSession.upload();
}
super.onPause();
What is the effect of calling super.onPause() after doing upload actions vs. before?
In general, when should one call super.onPause()?
You only call
super.onPause()in your ownActivity.onPause()override.Note that you don’t need to override this if you don’t need it. If you’re going to override it, then do not make slow processes in here or you might get an ANR.