title: How to add actions to my notification's button?
body: <p>Here is my code for notification:-</p>
  
  <pre><code>public void showNotification(String Name, String Rate, int Image_Source, int PandP, int Repeat) {
  
      RemoteViews remoteview = new RemoteViews(getPackageName(), R.layout.notification_layout);
  
      PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, SongsListActivity.class), 0);
      notification = new NotificationCompat.Builder(this)
              .setContent(remoteview)
              .setPriority(2)
              .setTicker(NameD.getText())
              .setSmallIcon(R.mipmap.ic_launcher)
              .setContentTitle(NameD.getText())
              .setContentText(RateD.getText())
              .setContentIntent(pi)
              .setAutoCancel(false)
              .setCustomBigContentView(remoteview)
              .build();
  
      notification.bigContentView = remoteview;
      remoteview.setImageViewResource(R.id.Repeat_N, Repeat);
      remoteview.setImageViewResource(R.id.P_and_P_N, PandP);
      remoteview.setTextViewText(R.id.Name_N, Name);
      remoteview.setTextViewText(R.id.Rate_N, Rate);
      remoteview.setImageViewResource(R.id.Image_N, Image_Source);
      notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
      notificationManager.notify(111111, notification);
  }
  </code></pre>
  
  <p>here is my xml of notification:-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:background="#2196F3"&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="100dp"
      android:background="#2196F3"
      android:orientation="horizontal"&gt;
  
      &lt;ImageView
          android:id="@+id/Image_N"
          android:layout_width="100dp"
          android:layout_height="100dp"
          tools:ignore="ContentDescription" /&gt;
  
      &lt;LinearLayout
          android:id="@+id/text_container"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"&gt;
  
          &lt;TextView
              android:id="@+id/Name_N"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1"
              android:gravity="bottom"
              android:textAppearance="?android:textAppearanceMedium"
              android:textColor="@android:color/white"
              android:textStyle="bold"
              android:maxLength="25"/&gt;
  
          &lt;TextView
              android:id="@+id/Rate_N"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1"
              android:gravity="top"
              android:textAppearance="?android:textAppearanceMedium"
              android:textColor="#F44336" /&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1"&gt;
  
              &lt;ImageButton
                  android:id="@+id/Repeat_N"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:src="@drawable/ic_repeat_white_48dp"
                  android:background="#2196F3"/&gt;
  
              &lt;ImageButton
                  android:id="@+id/Previous_N"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:src="@drawable/ic_skip_previous_white_48dp"
                  android:background="#2196F3"/&gt;
  
              &lt;ImageButton
                  android:id="@+id/P_and_P_N"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:src="@drawable/ic_play_arrow_white_48dp"
                  android:background="#2196F3"/&gt;
  
              &lt;ImageButton
                  android:id="@+id/Next_N"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:src="@drawable/ic_skip_next_white_48dp"
                  android:background="#2196F3"/&gt;
  
  
          &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p><a href="https://i.stack.imgur.com/kpXxv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kpXxv.png" alt=""></a></p>
  
  <p><strong>Layout of my notification</strong></p>
  
  <p>now how do i add action to the 4 buttons in the notification so that:-</p>
  
  <p>a) the Pause Imagebutton pauses the MediaPlayer mediaplayer and then change it image to play.</p>
  
  <p>b) the next and previous Imagebuttons call a method mediaplayer(int i)</p>
  
  <p>c) the Repet Imagebutton call a method changeRepeat()</p>