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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:42:50+00:00 2026-05-29T22:42:50+00:00

I have a notification which should give me some parameters when opening an activity

  • 0

I have a notification which should give me some parameters when opening an activity via said notification.

    private void notify_newOrders(int count) {
    int icon = R.drawable.ic_notification;

    String ns = Context.NOTIFICATION_SERVICE;
    NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);

    CharSequence tickerText = infotext;
    long when = System.currentTimeMillis();

    Notification notification = new Notification(icon, tickerText, when);   
    Context context = getApplicationContext();
    CharSequence contentTitle = "Title";
    CharSequence contentText = "Infotext";

    Intent notificationIntent = new Intent(this, TestActivity.class);       
    notificationIntent.putExtra("resuming", "123");
    notificationIntent.setAction("resuming");

    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);

    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

    notification.flags |= Notification.DEFAULT_ALL;
    notification.flags |= Notification.FLAG_AUTO_CANCEL;        

    notification.number = count;

    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);

    mNotificationManager.notify(WORKNOTIFICATION_ID, notification);         

}

In my activity I have the following:

    @Override 
public void onCreate(Bundle savedInstanceState) 
{ 
    try{
        super.onCreate(savedInstanceState);         

        setContentView(R.layout.main);
        Bundle extras = getIntent().getExtras();

        if(extras != null)
        {
            Log.d("YAY","got extras");
        }

The problem is, I never get any extras. I’ve been through and through similar kind of (resolved) problems here and trying to find out why they worked and mine didn’t has proven useless. Help!

In logCat I get these, no idea if they are relevant:

INFO/ActivityManager(59): Starting activity: Intent { act=resuming flg=0x24000000 cmp=com.test.test/.TestActivity bnds=[0,101][320,165] (has extras) }
WARN/ActivityManager(59): startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=resuming flg=0x24000000 cmp=com.test.test/.TestActivity bnds=[0,101][320,165] (has extras) }
  • 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-29T22:42:51+00:00Added an answer on May 29, 2026 at 10:42 pm

    Turns out the right thing was to make

    @Override 
    public void onNewIntent(Intent intent)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a < div > in my aspx page which has some notification
I have a notification that when pressed should launch an activity that in turn
I have created an activity which sends a number of notifications to status bar.
I have an object id currentObject; which I want to pass through notification. The
Which notification should I observe when the data in the document store in iCloud
In the iPhone Push Notification documentation, they have a code snippet in which they
I have a universal app which I decided should become iPad only from the
i currently have a Java Observer/Observable setup in which i switch on some field
I have a program in which I call a notification. The notification, if you
I have an app which has 3 dashboard items as an activity. So whenever

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.