Open TristanWiley opened 6 years ago
As an alternative to using ActivityManager, it's possible to have the application class listen for activity lifecycle changes. Then you can derive that the app is in the background if Application.currentForegroundActivity = null
or something. Not implying it's better, but now you have 2 options 🙂
In IncomingEventService,
getRunningTasks
is deprecated. This is used to get the foregroundTaskInfo and determine if our app is in the foreground.We need a non-deprecated way to do this.