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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:57:24+00:00 2026-05-18T19:57:24+00:00

I wanted to create a notification without the icon in the status bar (the

  • 0

I wanted to create a notification without the icon in the status bar (the state that is not expanded). I tried the custom expanded view and set the icon for this view only. But it did not work. When I give 0 as icon to the constructor, the icon disappears but notification also does not appear in the expanded view.

Notification notification = new Notification(0, “”, 0);

I tried a lot of combinations but didn’t come out with a solution. By the way, I know it is working because I saw this feature in some apps. 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-18T19:57:25+00:00Added an answer on May 18, 2026 at 7:57 pm

    QuickSettings did this and as I looked at that code I saw it uses the default constructor of Notification and pushes its icon to the right of the notification bar. I think it still uses space but has no icon.

    Some code:

    notification = new Notification();
    notification.flags |= Notification.FLAG_ONGOING_EVENT;
    notification.flags |= Notification.FLAG_NO_CLEAR;
    long hiddenTime = Constants.SDK_VERSION >= 9 ? -Long.MAX_VALUE : Long.MAX_VALUE;
    notification.when = visible ? System.currentTimeMillis() : hiddenTime; // align
    // left (0) / right (max) in status bar
    

    edit: oh sorry I missed an important line of code, in fact he uses a placeholder. But now you have some code 😉

    notification.icon = visible ? (status == Constants.STATUS_BLACK_ICON ? 
                                R.drawable.ic_logo_black : R.drawable.ic_logo_white)
                                : R.drawable.ic_placeholder;
    

    http://code.google.com/p/quick-settings/source/browse/trunk/quick-settings/src/com/bwx/bequick/receivers/StatusBarIntegrationReceiver.java

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

Sidebar

Related Questions

I wanted to create a notification without the icon in the status bar (the
I wanted to create a JFileChooser with thumbnail view of image files.So I subclassed
I wanted to create a layout like the CyanogenMod call log in that there
I wanted to create simple plugin using jquery. Also suggest me standard practice while
I wanted to create a file which has all the KeyPairs I need to
I wanted to create a string padding function for the use of left-padding a
I wanted to create a edit form with the help of ModelForm. and my
I wanted to create a web application. I thought of selecting Groovy or Grails.
I wanted to create a basic destroy link in Rails today, so I wrote
Imagine the following linq to observables statement: var x = from result1 in service1.operation()

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.