Android: How to give focus to a background Activity belonging to a different task? -
Say that the user has started my app and then stopped using the browser (so we have 2 jobs are ongoing tasks). After some time, something happens to my app that requires user attention, so it posts a notification to notify the user.
In your notification, you make an intentional call to start your app, if you ensure that it has the following flags then it will bring up instead of creating another example:
intents contentient = new intent (this, ABC. Square); ContentIntent.setFlags (Int. FLAG_ACTIVITY_CLEAR_TOP | INTENT.FLAG_ACTIVITY_SINGLE_TOP);
Comments
Post a Comment