title: Android notification, how to call custom function after click on button?
body: <p>I have a simple notification with three buttons. How can i call custom function after button click. I red, that here should be used pending intent, but i did not find any useful example.</p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>PendingIntent pIntent = PendingIntent.getActivity(context, 0, intent, 0);
  // I WOULD LIKE TO CALL THIS INTENT OR CUSTOM FUNCTION 
  Intent phoneCallIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "123456789"));
  
          // build notification
          // the addAction re-use the same intent to keep the example short
          Notification n  = new Notification.Builder(context)
                  .setContentTitle("New mail from " + "test@gmail.com")
                  .setContentText("Subject")
                  .setSmallIcon(R.drawable.ic_launcher)
                  .setContentIntent(pIntent)
                  .setAutoCancel(true)
                  .addAction(R.drawable.ic_launcher, "Call", phoneCallIntent) //CUSTOM INTENT OR FUNCTION CALLING
                  .addAction(R.drawable.ic_launcher, "More", pIntent)
                  .addAction(R.drawable.ic_launcher, "And more", pIntent)
                  .build();
  
  
          NotificationManager notificationManager =
                  (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
          notificationManager.notify(0, n);
  </code></pre>
  
  <p>How can i do it please?</p>
  
  <p>Thanks for any help.</p>