1
我想添加一個暫停按鈕,並在可能的情況下添加通知中的刪除按鈕。 像這樣:正常視圖中的Android通知按鈕
我怎樣才能做到這一點?
這是我的通知代碼:
notificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
context = getApplicationContext();
builder = new NotificationCompat.Builder(context)
.setContentTitle("Go!")
.setContentText("Timer set to " + waitingtime/1000 + " seconds")
.setTicker("Started!")
.setWhen(System.currentTimeMillis())
.setDefaults(Notification.DEFAULT_SOUND)
.setAutoCancel(false)
.setOngoing(true)
.setSmallIcon(R.drawable.notlogosmall);