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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:21:50+00:00 2026-06-16T06:21:50+00:00

Changing from a standard notification with text and a picture to more complex types

  • 0

Changing from a standard notification with text and a picture to more complex types with custom designed layout requires the use of RemoteViews class. And instead of using the setContentTitle(), I used setContent(remoteviews) method because of the custom view.

After changing to custom view I deleted the setContent, setSmallIcon, and setContentTitle mehods, however after I did that the notification never showed up again.

If I am using a custom view all I have to use us the setContent() method is that correct? they why does it not work with I remove the other methods?

RemoteViews remoteviews = new RemoteViews("com.test.example", R.layout.custom_notifications);

 NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(AudioService.this)
           .setContent(remoteviews)
            .setSmallIcon(R.drawable.ic_launcher)
            .setContentTitle("My notification")
            .setContentText("Hello World!")
            .setOngoing(true);
  • 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-16T06:21:51+00:00Added an answer on June 16, 2026 at 6:21 am

    Well since ICS I have not really touched the Notification Builder. Even to this day I still do it the old school way when GB was more popular. Example time:

            String ns = Context.NOTIFICATION_SERVICE;
            NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
    
                // Setup an intent for when the user taps the notification
            Intent notificationIntent = new Intent(this, SomeActivity.class);
            PendingIntent contentIntent = PendingIntent.getActivity(
                this, 0, notificationIntent, 0);
    
                // `icona` is the icon shown in the status bar. 
            Notification notification = new Notification(icona,
                "Ticker Text", System.currentTimeMillis());
    
                // These flags should be self explanatory 
            notification.flags |= Notification.FLAG_NO_CLEAR;
            notification.flags |= Notification.FLAG_ONGOING_EVENT;
    
                // This is where you select the xml for you custm view
            RemoteViews contentView = new RemoteViews(getPackageName(),
                R.layout.custom_notification);
    
            notification.contentView   = contentView;
            notification.contentIntent = contentIntent;
    
                // Some ID number for the OS to keep track of your notification     
            int HELLO_ID = 123456;
    
                // Send the notification
            mNotificationManager.notify(HELLO_ID, notification);
    

    This should work for every release of android. Simply because Notification.Builder is a wrapper to make it easier to create status bar notifications. Also the builder calls these methods if you look at androids source code.

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

Sidebar

Related Questions

I'm creating some custom views for the Django admin interface that use the standard
I'm trying to use the the standard android button in my layout, but make
We are changing from SourceSafe 2005 to visual svn. How can an exisiting project
We're in the middle of changing from VSS to Subversion and we have a
I want to reload my page (PHP) on changing value from the dropdownmenu and
Does anyone know a possibility to protect a string-wildcard from changing in a TextArea?
How do I prevent a form file input element from changing via the onclick
I've looked through many similar threads which seem to range from changing settings to
I'm changing my project from working with Linq-to-SQL to working with Entity Framework. I
I'm often changing files not from subversion, but from finder, or other sources. Recently,

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.