PDA

View Full Version : ویرایش آیکن اکشن دوم از نوتیفیکیشن



kamran_14
شنبه 11 آبان 1398, 15:38 عصر
سلام
من میخواهم دوباره مقدار و آیکن اکشن دوم را تغییر دهم. اما جواب نمی‌دهد. چرا؟




Notification.Builder notification = new Notification.Builder ( this ) .setSmallIcon ( R.drawable.ic_play )
.setContentTitle ( "madaraneh.mp3" )
.setContentText ( "madaraneh" )
.setContentIntent ( PendingIntent.getActivity ( this, 0, new Intent ( this, MusicPlayerActivity.class ), 0 ) )
.setOngoing ( true )
.addAction ( R.drawable.ic_rewind, "Rewind", rewindPending )
.addAction ( iconAction, "Play", playPending )
.addAction ( R.drawable.ic_forward, "Forward", forwardPending )
;
NotificationManager notificationManager=(NotificationManager)getSystem Service ( NOTIFICATION_SERVICE );
notification.build ().actions[1]=new Notification.Action (R.drawable.a1,"hhhhhhhh",playPending);

notificationManager.notify ( 12,notification.build () );

کدی که برای ویرایش آیکن اکشن دوم نوشتم این است:



notification.build ().actions[1]=new Notification.Action (R.drawable.a1,"hhhhhhhh",playPending);