Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8969509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:36:04+00:00 2026-06-15T17:36:04+00:00

I am using PendingIntent to take user from push notifications to Activity B i,e

  • 0

I am using PendingIntent to take user from push notifications to Activity B i,e when user clicks on notification it will go to screen B.

I want it to be screen B only when application is loaded and running, else it should go to screen A. I have implemented this as well.

Now, there is scenario, wherein I have received the notifications, hence the intent is set to Screen B, but I haven’t clicked it. If I kill the application process using DDMS or if the android kills the application before I click on notification and then I click it, it tries to load activity B which is not what I want in this case. I would like to load activity A in this case which is first sceen of the app.

Please, suggest what to do !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:36:05+00:00Added an answer on June 15, 2026 at 5:36 pm

    It sounds like you’re deciding whether to launch activity A or B at the time you post the notification, which, as you’ve discovered, will not work: once you submit the notification to the Notification Manager, you can’t make changes to it.

    The way to do this is to always launch the same activity, but have that activity potentially redirect the user to a different activity based on whatever criteria you want. For example, you could launch activity B, which then bounces the user immediately to A if the app is not already in the foreground. (You could also do this with a third activity whose job is simply to route the user around, or with a service, or with a broadcast.)

    Now the decision about where to send the user is made at the time the user taps on the notification, rather than at the time the notification is posted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an application that creates notifications, using the following code: // notification
I have an activity that creates notifications using the following code: Notification notification =
I'm trying to use custom notifications in my Android application using Google's sample from
I am using push notifications in Android. When I receive a push notification, I
I am using the below code to generate the notification in my application @Override
I am using the following code to show a notification in my android application,
I want to launch my app's details page using market application by clicking a
Lets say I have an app and within its activity I will register pendingIntent
I have implemented the push notifications using C2DM code in my project. It is
I have an application, which sets an alarm using AlarmManager, which starts another Activity

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.