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

  • Home
  • SEARCH
  • 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 6990015
In Process

The Archive Base Latest Questions

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

Android passing multiple data to notification when i click on notification its only open

  • 0

Android

passing multiple data to notification
when i click on notification its only open recent one

final Notification notifyDetails = new Notification(R.drawable.e4,"temp",System.currentTimeMillis());
                    long[] vibrate = {100,100,200,300};
                    notifyDetails.vibrate = vibrate;
                    notifyDetails.defaults =Notification.DEFAULT_ALL;
                    Context context = getApplicationContext();
                    CharSequence contentTitle = "hello"
                    CharSequence contentText = "You have a notification" ;
                    Intent notifyIntent = new Intent(context, Send_Notification_Act.class);
                    notifyIntent.putExtra("name", "sunil");
                    notifyIntent.putExtra("ID", SIMPLE_NOTFICATION_ID);
                    PendingIntent intent =
                    PendingIntent.getActivity(Back_Reciver.this, 0,
                    notifyIntent, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
                    notifyDetails.setLatestEventInfo(context, contentTitle, contentText, intent);
  • 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-27T19:17:26+00:00Added an answer on May 27, 2026 at 7:17 pm
    private NotificationManager mNotificationManager;
    private int SIMPLE_NOTFICATION_ID = 0;
    private int SIMPLE_NOTFICATION_ID_A = 1;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
    
        Button quick = (Button) findViewById(R.id.quickbutton);        
    
        quick.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
    
                displayNotification("Text", "Text", "Text", MyActivity.class,       SIMPLE_NOTFICATION_ID);
    
                displayNotification("Text", "Text", "Text", MyActivityA.class, SIMPLE_NOTFICATION_ID_A);
            }
        });
    }
    
    private void displayNotification(String extra, String contentTitle, String   contentText, Class<?> cls, int id) {     
        Notification notifyDetails = new Notification(R.drawable.icon, "New Alert!",   System.currentTimeMillis());
        Intent intent = new Intent(this, cls);
        intent.putExtra("extra", extra);
        PendingIntent contentIntent = PendingIntent.getActivity(getApplicationContext(), id, intent, PendingIntent.FLAG_ONE_SHOT);
        notifyDetails.setLatestEventInfo(getApplicationContext(), contentTitle, contentText, contentIntent);
        mNotificationManager.notify(id, notifyDetails);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am passing a parameter to a new activity using tab host in android
I am working on an Android app that has multiple screens the user will
In android you could set a navigation list in action bar by passing spinner
How would i go about passing an image to the next page for android?
I'm passing data to a ListView to display some restaurant names. Now when clicking
I'm starting an Android app which will have multiple Activities. It will be using
My Android app is getting called by an intent that is passing information (pendingintent
I'm new to android and I'm trying to make a simple android program that
I want to pass one or more variables between activities in android. One solution
I have an application with multiple activities. In the main class I open 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.