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 6945391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:25:49+00:00 2026-05-27T13:25:49+00:00

I am experiencing a strange behavior with my android application when dealing with a

  • 0

I am experiencing a strange behavior with my android application when dealing with a notification that is created from a BroadcastReceiver when a C2DM message arrives on the mobile device. The flow I am executing to experience this behavior is the following one:

  1. Start my application, DashboardActivity is displayed;
  2. Close application either by pressing home button or back button;
  3. Receive the push message and create the notification;
  4. Click the notification item and the activity BookingOfferActivity is launched;
  5. Close the BookingOfferActivity either by pressing home or back button or calling finish()
  6. Long press home button and select my application from recent applications
  7. BookingOffcerActivity is displayed instead of DashboardActivity

The BookingOfferActivity is being launched from the notification using the following code:

    Intent notificationIntent = new Intent(context, BookingOfferActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Bundle b = new Bundle();
b.putSerializable("booking", booking);
notificationIntent.putExtras(b);

PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);

Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
long[] vibrate = {0,100,200,300};
notification.vibrate = vibrate;
notification.flags = Notification.FLAG_AUTO_CANCEL;

NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(AppUtil.getNextPushIndexBooking(), notification);

BookingOfferActivity is defined in the AndroidManifest this way:

    <activity android:name=".activity.BookingOfferActivity" 
        android:label="@string/app_name" 
        android:screenOrientation="portrait" />

and my DashboardActivity is defined like this:

    <activity android:name=".activity.DashboardActivity"
              android:label="@string/app_name" 
              android:configChanges="orientation|keyboardHidden" 
              android:windowSoftInputMode="stateHidden|adjustPan">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

The reason I am calling it a strange behavior is that I would like to start DashboardActivity whenever my application is started or restarted by the user, not by the notification item. So after closing, finishing or destroying BookingOfferActivity and reopening by application by accessing recent opened application (long press on home button) or accessing the launcher icon on the application list, I would like to see the Dashboard.

I create a question similar to this one but I didnt provide too much details, so I closed the other one and opened this one with more data.

Many thanks for any guidance on how to solve this problem

T

  • 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-05-27T13:25:49+00:00Added an answer on May 27, 2026 at 1:25 pm

    I’m not sure, but I suppose that in your scenario second activity just go to the top of activity stack and will be shown until application wont be killed. We have approximately same problem and solv it in easy way: Notification start main(first) activity with extra “go to second immediately”. in onCreate of first activity check this extra and start second activity if needed. With this solution you should be careful with pressing back button – if you dont want to show first activity in case of “notification start” you should care about it in onResume of first activity

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

Sidebar

Related Questions

I'm experiencing some strange behavior for which I can't find any documented knowledge. Here's
I am experiencing a strange behaviour of my application in Chrome browser (No problem
I'm experiencing something really strange! I have a div that I'm hiding with JS
I am experiencing some strange behavior with OSQL, and would appreciate any help. I
I am experiencing some very strange behavior with Blend: Since weeks i am working
Im experiencing strange behavior when converting String to DateTime and then again ToString(). Convert.ToDateTime(16-02-2012).ToString(MM/dd/yyyy)
I am experiencing some strange behavior with SQL Server CE 3.5 SP2. I have
I am experiencing a strange behavior with very basic web service development. This question
I'm experiencing some strange behavior with a project i'm working on: http://daft.net76.net/yah/ When you
I'm experiencing what I would consider somewhat strange behavior. Specifically if I have a

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.