How to lunch another activity when user open notification

I developed an android application using the urban airship to push notification but I don't know how to next to specific activity (e.g. NotificaitionAcitivity) according to the value that submitted to notification when user open notification when an app doesn't  launch yet.

How do I detect any value that submitted to notification?

How do I launch any activity when user open notification?

Didn't find what you were looking for?

New post

Comments

4 comments

  • Hi Thanapong,

    Launching an activity when a user taps on a notification is what we refer to as deep-linking.

    In order to implement it, you'll need to follow the Android Deep-Linking guide. This will help you get set up to detect parameters passed in to the deep-link and launch a specific activity based on the value of that parameter.

    Once you have that implemented, all you need to do is specify which page you want to deep-link to, and the app should handle the rest! 

    Comment actions Permalink
    0
  • Thank you very much :)

    Comment actions Permalink
    0
  • No problem!

    Comment actions Permalink
    0
  • When the user taps on a notification, you can open another activity by creating an Intent for the target activity and wrapping it in a PendingIntent. Set this PendingIntent in the notification builder using the setContentIntent method. It’s like checking your lunchtime results—when you tap the notification, it should take you straight to the activity, just like how you expect to see your lottery outcome directly.

    Comment actions Permalink
    0

Please sign in to leave a comment.