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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:28:11+00:00 2026-05-15T15:28:11+00:00

My target: download files in parallel, and when file downloads complete, I get notifications.

  • 0

My target: download files in parallel, and when file downloads complete, I get notifications.

Those notifications are suppose to launch an activity when you click on it which gets unique parameters through putExtra.

The problem is that I can’t have different values in each launch of that activity.

Each time the activity, which is being launched through the notification bar, launches it destroys the extra of the ones which haven’t been launched yet (the ones that still appear on the notification bar).

How do I keep all my notifications with their own parameters?

Here is my code:

if (messagesManager == null)
{
    messagesManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
}

notification = new Notification(R.drawable.icon, message, System.currentTimeMillis());

// for launch activity
Intent intent = new Intent(context, DialogActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("fileName", fileName); //- this is where i put my extra's!!
intent.putExtra("onSdcard", onSdcard);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);

notification.setLatestEventInfo(context, "DownloadManager", message, contentIntent);
notification.flags = notification.FLAG_AUTO_CANCEL;
int noticeId = generateNotificationId(requestId);
messagesManager.notify(noticeId, notification);

Now this is the dialog activity:

protected void onCreate(Bundle savedInstanceState)
{
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    Intent i = getIntent();
    boolean onSdcard = i.getBooleanExtra("onSdcard", true);
    String fileName = i.getStringExtra("fileName");
    ...
}

I tried to use this technique as it was written in another post here, but it didn’t work.

intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
  • 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-15T15:28:12+00:00Added an answer on May 15, 2026 at 3:28 pm

    Please check the linked duplicate,

    you need two things

    • you need to add an action string
    • the action string must be unique, probably a timestamp added to it would be good
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a link <a id=DownloadLink href='controller/action' target=_blank>Download File</a> that has to open a
In my project I have created a Method which will download the files. When
Target failed to run: Remote exception encountered: Faild to get task for pid 3103
My target is to create a custom Date field (which should work with Doctrine).
I'm trying to download files in subdirectories from an ftp server with ant. The
In my WebView am trying to download some files from some web sites but
At the MinGW download page you can download the Cross-Hosted MinGW Build Tool which
I'm trying to create a Makefile that will download and process file a file
I am issuing many parallel robocopy calls to copy files from one network share
I am trying to download several mp3 files using a script in java. The

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.