Skip to content Skip to sidebar Skip to footer

Android Notification - How To Bring The Activity To Front Without Recall The Activity

In my app, in an activity(AndroidNotification.java) i am doing the following: 1) i am showing a notification when user press home button. 2) when user click the notification i sho

Solution 1:

i have solved by adding the following in on create method

if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) { 
    // Activity was brought to front and not created, 
    // Thus finishing this will get us to the last viewed activity 
    finish(); 
    return; 
}

Post a Comment for "Android Notification - How To Bring The Activity To Front Without Recall The Activity"