-1

How can show a notification like Screen Capture. The below image shows it enter image description here

mob_web_dev
  • 2,342
  • 1
  • 20
  • 42

1 Answers1

2

You can achieve this with Notification.BigPictureStyle() like this:

 Notification notif = new Notification.Builder(mContext)
 .setContentTitle("New photo from " + sender.toString())
 .setContentText(subject)
 .setSmallIcon(R.drawable.new_post)
 .setLargeIcon(aBitmap)
 .setStyle(new Notification.BigPictureStyle()
     .bigPicture(aBigBitmap))
 .build();

where aBitmap ist your Image you want to display. Read more about this here: https://developer.android.com/reference/android/app/Notification.BigPictureStyle.html

babadaba
  • 814
  • 5
  • 20
  • how i can add a button on below ? – mob_web_dev Jul 21 '16 at 05:48
  • You can add .addAction(R.drawable.yourdrawable, "Yourtext", pendingIntent); The pendingIntent is to determine what action the user has clicked. So for example PendingIntent pIntent = PendingIntent.getActivity(this, 100, intent, 0);. When you receive a click on a notification button you can check in your app if the number is 100, 101 or something else, to check what button was clicked. – babadaba Jul 21 '16 at 08:02