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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:30:32+00:00 2026-06-11T19:30:32+00:00

I am working on an Android application.The app is like native sms application.I am

  • 0

I am working on an Android application.The app is like native sms application.I am facing a problem in notification part. In native app, they handle the notification in the following way.

1)if messages from an specific number ,then the click on the notification will lead to the chat page of the corresponding contact and the notification will clear.

2)if messages from the different number, then the click on the notification will lead to home page and notification won’t clear.

I had done the first part and I don’t have any idea to do the second part.
Is there any way to leave the notification part without clear and call an 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-06-11T19:30:34+00:00Added an answer on June 11, 2026 at 7:30 pm

    you have to add a flag:

     notification.flags |= Notification.FLAG_ONGOING_EVENT;
    

    here a whole example:

     private static final int NOTIFICATION_EX = 0;
     private NotificationManager notificationManager;
    

    …

    in onCreate:

        notificationManager = (NotificationManager) 
        getSystemService(Context.NOTIFICATION_SERVICE);
    
    
    
    int icon = R.drawable.youricon;
        CharSequence tickerText = "Sticky notification";
        long when = System.currentTimeMillis();
    
        Notification notification = new Notification(icon, tickerText, when);
    
        Context context = getApplicationContext();
        CharSequence contentTitle = "Sticky notification";
        CharSequence contentText = "...click here and it wont go away...";
        Intent notificationIntent = new Intent(this, mainmenu.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
                | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        PendingIntent contentIntent = PendingIntent.getActivity(this, 
            0, notificationIntent, 0);
    
        notification.setLatestEventInfo(context, contentTitle, 
            contentText, contentIntent);
        notification.flags |= Notification.FLAG_ONGOING_EVENT;
    
        notificationManager.notify(NOTIFICATION_EX, notification);
    

    the intent you can adjust to whatever you like.

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

Sidebar

Related Questions

I am working on android chat application. I am facing a problem in send
I am working on one Android Application, In this app I like to record
I am working on an Android application. In my app I am facing a
I'm working with FlashBuilder 4.6 to develop Android app. In the application there is
Actually, I am facing a problem in Android. I am creating an application that
I'm working on an Android application where I'd like to have the largeHeap and
I'm currently working on an Android app. I would like to use the app
I would like to publish my application as In-app in android market. so far
i am working on an android database application and have fired query like this
I'm working on an Android application, and I decided that I really like 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.