0

Hi I am developing an android app to receive the push notification from parse.com with below requirement .

application have two activity say A and B. when i launch my application activity A will be displayed and then activity B when i click button on activity A.

I want to open activity B when i receive push notification message and display on it whether my app running in background or not.

if running on background/or not how can i do that in both the cases.

Please help me.

Nagesh
  • 41
  • 4
  • 1
    Possible duplicate of [Open application after clicking on Notification](http://stackoverflow.com/questions/13716723/open-application-after-clicking-on-notification) – tkanzakic Dec 18 '15 at 15:25

1 Answers1

0

Method onNewIntent() will be called is case:

This is called for activities that set launchMode to "singleTop" in their package, or if a client used the FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity().
In either case, when the activity is re-launched while at the top of the activity stack instead of a new instance of the activity being started, onNewIntent() will be called on the existing instance with the Intent that was used to re-launch it.

If instance of your activity B isn't exist then onCreate() will be called.

xUser
  • 81
  • 6