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

The Archive Base Latest Questions

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

I am developing an Android app and I want a status bar notification that

  • 0

I am developing an Android app and I want a status bar notification that cannot be cleared by the user. Does anyone know how to do that? I’ve seen them with apps like Skimble where a non-clearable notification appears while using the application.

Also, I’d when the user clicks/presses the notification, I want it to return to the app instance that is already running. Right now it starts a new instance. Again like the Skimble app, I just want to return to the already running instance of the app.

Thanks.

  • 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-25T20:17:05+00:00Added an answer on May 25, 2026 at 8:17 pm

    I found a solution to this problem. I used FLAG_ONGOING_EVENT to make the notification persist. Here’s the code:

      String ns = Context.NOTIFICATION_SERVICE;
      NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
    
        int icon = R.drawable.mypic;
        long when = System.currentTimeMillis();
        Notification notification = new Notification(icon, tickerText, when);
        notification.flags = Notification.FLAG_ONGOING_EVENT;
    
        Context context = getApplicationContext();
        CharSequence contentTitle = "Title Text";
        CharSequence contentText = "Content text.";
    
        Intent intent = new Intent(this, MyClass.class); 
        intent.setAction("android.intent.action.MAIN"); 
        intent.addCategory("android.intent.category.LAUNCHER"); 
        PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, 0); 
    
        notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
    
        final int HELLO_ID = 1;
        mNotificationManager.notify(HELLO_ID, notification);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im developing an android 3.0 + app. I want to remove the status bar
i am developing an android app that fetches an RSS feed, now i want
I am developing an Android app and I want to detect when the user
I want to place a hyperlink on android app that I am developing. I
I am developing an android app. I want to know through an event or
A new question about android and services. Currently I'm developing a App that should
I'm developing an Android app and I want to search for the first result
I am developing an android app in which i want to send (name,email, cell
I am developing an entertainment app in android. I want to play background music,
Hi! I'm developing an internet based app in android. What i want to do

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.