title: Android: Custom notification appearance issue
body: <p>I am using <code>MediaPlayer</code> in my app. I am adding an <code>Ongoing Notification</code> with media player controls (such as previous, next and stop buttons) in my app, so that users don't have to go in the app to access those controls. It looks fine on platforms <strong>4.x</strong>. Here is the screenshot of the notification on Android 4.2.2.</p>
  
  <p><img src="https://i.stack.imgur.com/NHPsn.png" alt="Notification on Android 4.2.2"></p>
  
  <p>But, on Android 2.2, it looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/pQqPs.png" alt="Notification on Android 2.2"></p>
  
  <p>My code is as follows:</p>
  
  <pre><code>private Notification generateNotification() {
      Log.d(TAG, "generateNotification called");
  
      Intent actionIntent = new Intent(getApplicationContext(),
              AartiActivity.class);
      PendingIntent pi = PendingIntent.getActivity(getApplicationContext(),
              0, actionIntent, PendingIntent.FLAG_UPDATE_CURRENT);
      RemoteViews mNotificationView = new RemoteViews(getPackageName(),
              R.layout.notification_view);
      NotificationCompat.Builder builder = new NotificationCompat.Builder(
              getApplicationContext());
      builder.setSmallIcon(R.drawable.icon);
      builder.setContent(mNotificationView);
      builder.setOngoing(true);
      builder.setTicker("Aarti Sangrah");
      builder.setContentIntent(pi);
      mNotificationView.setImageViewResource(R.id.imgAppIc, R.drawable.icon);
      mNotificationView.setTextViewText(R.id.txtAartiPlaying, mediaName);
  
      return builder.build();
  }// generateNotification
  </code></pre>
  
  <p>And then, I called <code>startForeground(1, generateNotification());</code> in <a href="http://developer.android.com/reference/android/media/MediaPlayer.OnPreparedListener.html#onPrepared%28android.media.MediaPlayer%29" rel="nofollow noreferrer">onPrepared()</a>.</p>
  
  <p>The <a href="http://developer.android.com/reference/android/widget/RemoteViews.html" rel="nofollow noreferrer">Remote Views</a> is available since API level 1. And, it is well supported also. I read somewhere, it was not supported prior to Honeycomb. But, on several devices having Android 2.x, this feature is available. Also, in order to check this, I looked at the source code of Music Player of Android 2.2 from <a href="https://android.googlesource.com/platform/packages/apps/Music.git/+/froyo" rel="nofollow noreferrer">here</a>. </p>
  
  <p>Here, is the snippet from its <a href="https://android.googlesource.com/platform/packages/apps/Music.git/+/froyo/src/com/android/music/MediaPlaybackService.java" rel="nofollow noreferrer">Music Player Service</a>.</p>
  
  <pre><code>RemoteViews views = new RemoteViews(getPackageName(),
                  R.layout.statusbar);
          views.setOnClickPendingIntent(R.id.btnTest, PendingIntent
                  .getActivity(getApplicationContext(), 0,
                          new Intent(getApplicationContext(),
                                  MusicBrowserActivity.class),
                          PendingIntent.FLAG_UPDATE_CURRENT));
          views.setImageViewResource(R.id.icon,
                  R.drawable.stat_notify_musicplayer);
          if (getAudioId() &lt; 0) {
              // streaming
              views.setTextViewText(R.id.trackname, getPath());
              views.setTextViewText(R.id.artistalbum, null);
          } else {
              String artist = getArtistName();
              views.setTextViewText(R.id.trackname, getTrackName());
              if (artist == null || artist.equals(MediaStore.UNKNOWN_STRING)) {
                  artist = getString(R.string.unknown_artist_name);
              }
              String album = getAlbumName();
              if (album == null || album.equals(MediaStore.UNKNOWN_STRING)) {
                  album = getString(R.string.unknown_album_name);
              }
  
              views.setTextViewText(
                      R.id.artistalbum,
                      getString(R.string.notification_artist_album, artist,
                              album));
          }
  
          Notification status = new Notification();
          status.contentView = views;
          status.flags |= Notification.FLAG_ONGOING_EVENT;
          status.icon = R.drawable.stat_notify_musicplayer;
          status.contentIntent = PendingIntent.getActivity(this, 0,
                  new Intent("com.android.music.PLAYBACK_VIEWER")
                          .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0);
          startForeground(PLAYBACKSERVICE_STATUS, status);
  </code></pre>
  
  <p>The Remote Views has been used in this code. It had two <code>TextViews</code>. I modified the code by adding a button to it, and also performed action on button click. Everything worked fine on every platform. </p>
  
  <p>Same thing, I want with my application. But, on 2.2, it looks as I had shown above in the screenshot. I thought it is because of white colors text and button so tried changing the colors of button and text, but no luck. As far as I understand, only thing I figured out is remote view is not inflated on Android 2.2 (in my case). I am not getting why notification is not appearing properly on Android 2.x platforms.  </p>