title: Change button background on click event , notification bar
body: <p>i want to Change button background on click event , notification bar</p>
  
  <p>for eg. i have button with text play which is on notification bar when i click on play it should be change to pause and again if i click on pause this pause text should be changed to play text, how can we do it any help is appreciated
  thanks in advance</p>
  
  <p>it is more like music player has on going notification so we can play and pause the media using notification bar as well.</p>
  
  <pre><code>NotificationManager notificationManager = (NotificationManager)        getSystemService(Context.NOTIFICATION_SERVICE);
      RemoteViews contentv = new RemoteViews(getPackageName(),
              R.layout.notification_bar);
  
      int icon = R.drawable.noti_launcher;
      CharSequence tickerText = "notification";
      long when = System.currentTimeMillis(); // now
      Notification notification = new Notification(icon, tickerText, when);
  
      Context context = getApplicationContext();
  
      notification.contentView = contentv;
      Intent laucherIntent = new Intent(this, NavigationActivity.class);
  
      Intent i = new Intent(AlarmClock.ACTION_SET_ALARM);
  
      PendingIntent launcherPI = PendingIntent.getActivity(this, 0,
              laucherIntent, 0);
  
      PendingIntent pi = PendingIntent.getActivity(this, 0, i, 0);
      Intent flaotIntent = new Intent(this, FloatMainActivity.class);
      PendingIntent floatPI = PendingIntent.getActivity(this, 0, flaotIntent,
              0);
  
      PendingIntent wifiPI = PendingIntent.getBroadcast(context, 0,
              new Intent(Constants.ACTION_WIFI), 0);
      PendingIntent btPI = PendingIntent.getBroadcast(context, 0, new Intent(
              Constants.ACTION_BLUETOOTH), 0);
      PendingIntent mobileDataPI = PendingIntent.getBroadcast(context, 0,
              new Intent(Constants.ACTION_DATA), 0);
      PendingIntent alarmsPI = PendingIntent.getBroadcast(context, 0,
              new Intent(Constants.CUSTOM_ACTION), 0);
              contentv.setImageViewResource(R.id.bluetooth, R.drawable.noti_wifi);
      notification.flags |= Notification.FLAG_ONGOING_EVENT;
  
      contentv.setOnClickPendingIntent(R.id.bluetooth, btPI);
      contentv.setOnClickPendingIntent(R.id.wifi, wifiPI);
      contentv.setOnClickPendingIntent(R.id.data, mobileDataPI);
      contentv.setOnClickPendingIntent(R.id.alarm, pi);
      contentv.setOnClickPendingIntent(R.id.icon, launcherPI);
      contentv.setOnClickPendingIntent(R.id.float_notification, floatPI);
  
      notificationManager.notify(1, notification);
  </code></pre>