Version 4.4.1
This updates the AppStateManager
to maintain a WeakReference
to the current Activity
, and updates the background/foreground logic to use the state of that WeakReference
to determine if there is an active Activity. This makes it so that the SDK can be initialized in any Activity (ie not the launch Activity), and will properly interpret if we're in the foreground or background. Prior to this, a counter was used which was unable to handle the case where we're told than an Activity is stopping that we've never actually seen before.
Generally speaking the mParticle SDK should be initialized as early as possible, ideally in the Application#onCreate
method. This update makes it possible to initialize the SDK later if absolutely necessary in your app.