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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:26:40+00:00 2026-06-03T06:26:40+00:00

In my application I’m displaying notification text and icon on the notification bar but

  • 0

In my application I’m displaying notification text and icon on the notification bar but my problem is that when the user presses clear on the notification bar it gets cleared. I want to prevent it!? And some other issues too:

  1. I want to create notifications for my application by different activities, say one on start it displays “Welcome to app”, the second activity displays “please select”, in “Data send activity” it displays “Records sent successfully”!!
  2. How to remove the notification on application exit.
  3. How to disable users to clear the notification when they press the clear button on the notification bar
  4. How to remove a notification from the status bar when the user presses it to open an activity?

Any help?

My current code

private void Notification(String notificationTickerText, String Title,
            String text, Notification nt) {
        notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        int icon = R.drawable.nicon;
        CharSequence tickerText = notificationTickerText;

        long when = System.currentTimeMillis();
        nt = new Notification(icon, tickerText, when);

        Context context = getApplicationContext();
        CharSequence contentTitle = Title;
        CharSequence contentText = text;
        Intent notificationIntent = new Intent(this, frmLogin.class);

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

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

        notificationManager.notify(1, nt);
    }
  • 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-06-03T06:26:42+00:00Added an answer on June 3, 2026 at 6:26 am

    If you read http://developer.android.com/guide/topics/ui/notifiers/notifications.html that will probably answer all your questions.

    It mentions that you can use the following to prevent a notification from being cleared:

    FLAG_NO_CLEAR flag

    Add this to the flags field to indicate that the notification should not be cleared by the "Clear notifications" button. This is particularly useful if your notification is on-going.

    You can use the FLAG_AUTO_CANCEL to cancel your notifications, but I’m not entirely sure if that will work when combined with FLAG_NO_CLEAR. If it doesn’t you’ll have to cancel the notification manually.

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

Sidebar

Related Questions

Application : HTA (therefore IE) This is an application that uses SendKeys to populate
Our application takes text from a web form and sends it via email to
my application use 10 threads that to read a lot of html file.similar the
Application: This is a workshop proposal system for a conference. A user can create
The application crashes on the row: [uids addObject:user.uid]; Who can tell why??
My application (the bootstrap application for an installer that I'm working on needs to
My application is mostly organised in layers so I found that something like the
My application allows user to upload pdf files and store them on the webserver
// Application Drupal 7 // Problem Background My website imports product data from a
Application use NHibernate. I Have object A that contains set of objects B. I

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.