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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:57:09+00:00 2026-05-27T21:57:09+00:00

a notification pops up when I get a new task. On click on that

  • 0

a notification pops up when I get a new task. On click on that notification, it goes to TestExList.java activity.

private void createNewTaskNotification(String s, String id) {
    CharSequence title = "TASK";
    CharSequence message = s;

    notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    Notification notification = new Notification(R.drawable.checkyes, s,
            System.currentTimeMillis());

    notification.flags = Notification.FLAG_AUTO_CANCEL;

    notification.defaults |= Notification.DEFAULT_SOUND;
    notification.defaults |= Notification.DEFAULT_VIBRATE;

    Intent notificationIntent = new Intent(context, TestExList.class);
    notificationIntent.putExtra("EmpID", Functions.getLoginEmpID(context));
    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP );
    PendingIntent pendingIntent = PendingIntent.getActivity(context,
            Integer.parseInt(id), notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

    notification.setLatestEventInfo(context, title, message, pendingIntent);
    notificationManager.notify(Integer.parseInt(id), notification);
}

The way it’s working is, if i am on another screen, click on notification takes me to TestExList.java.

If i am on the same screen(TestExList.java), it is NOT loading that page aagain. I would like to refresh that page so that I can see my new task on that page.

what am I doing wrong ?

  • 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-27T21:57:09+00:00Added an answer on May 27, 2026 at 9:57 pm

    remove this line

    notificationIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP );
    

    this line pops up the activity from activity stack if activity exists, otherwise creates a new instance of the activity, hope this helps.

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

Sidebar

Related Questions

i want to build a little app that pops up a tray notification (or
I have a normal notification system that looks like this: Notification notification new Notification(
Is there a way to disable that annoying balloon notification that pops up when
Possible Duplicate: Notification of new S3 objects We've got an app that stores user
From Notification Watcher source. - (void)selectNotification:(NSNotification*)aNotification { id sender = [aNotification object]; [selectedDistNotification release];
I'm creating a notification with something similar to the following: Intent ni = new
What is Windows' best I/O event notification facility? By best I mean something that
I want to monitor a folder. Every time a notification pops up i want
I currently have a notification that displays in the notification bar and when the
The Notification sound is of 20 sec, but i want to repeat that sound

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.