2016-07-20 9 views
-2

スクリーンキャプチャのような通知を表示する方法。表示したいaBitmapイストあなたのイメージスクリーンキャプチャ通知のような通知を表示する方法

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(); 

: 下の画像は、次のように)あなたがNotification.BigPictureStyle(でこれを達成することができます enter image description here

答えて

1

それを示しています。ここをクリックしてください: https://developer.android.com/reference/android/app/Notification.BigPictureStyle.html

+0

どのようにボタンを下に追加できますか? – Debugger

+0

.addAction(R.drawable.yourdrawable、 "Yourtext"、pendingIntent);を追加できます。 pendingIntentは、ユーザーがクリックしたアクションを判別するためのものです。たとえば、PendingIntent pIntent = PendingIntent.getActivity(this、100、intent、0);となります。通知ボタンをクリックすると、そのボタンがクリックされたかどうかを確認するために、番号が100,101などであればアプリをチェックインできます。 – babadaba

関連する問題