Android application current activity bring to front issue

I have a basic question for which I don’t think attaching any code-snippet may help. When we press home button while an app is in front we go to the home page and the app loses its focus.

Now, My application has to have notification icon in the status bar. And as in my application, there is a possibility of having 2-3 activity visible(one above another in dialogue view). In certain situation, I am not really sure as to how could I resume such state when I press notification icon in the status bar.

  • What is considered onPageFinished in the Android WebViewClient?
  • Plural definition is ignored for zero quantity
  • Android Volley MalformedURLException Bad URL
  • Get value (String) of ArrayList<ArrayList<String>>(); in Java
  • LayoutInflater.Factory onCreateView is not called with 22.1+ support library
  • In an Android App, when are resources loaded to memory?
  • But, when I press home button and then press the application icon in the home screen I get everything as expected.

    So, is there any way, by which I can do the same with notification bar icon.

    Related posts:

    Add ViewPagerIndicator to Android Studio
    Android CheckBox &mdash; Restoring State After Screen Rotation
    When to use an aidl based service?
    How to change the icon of an Android app in Eclipse?
    How to refresh a Fragment of a FragmentPagerAdapter?
    getFileDescriptor returns null while reading mp3 files from the expansion files
  • Android setBackgroundResource cause out of memory excepiton
  • Disable Scrolling in child Recyclerview android
  • java.lang.outofmemory error (web services) on android
  • onActivityResult returns null data for an Image Capture
  • How can I force the Action Bar to be at the bottom in ICS?
  • Custom Dialog without title and border
  • 2 Solutions collect form web for “Android application current activity bring to front issue”

    There are 2 ways of doing this:

    1. Notification to restore a task rather than a specific activity?

    2. Resume application and stack from notification

    The notification bar icon is a PendingIntent, isn’t it?
    A PendingIntent can take an Intent to broadcast as soon as you click on the notification.
    You can find an example at “3. Define the notification’s message and PendingIntent:”

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.