-1
NotificationCompat.Builder builder = new NotificationCompat.Builder(
context).setContentTitle("Recording...")
.setContentText("Currently recording")
.setAutoCancel(true)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setWhen(System.currentTimeMillis()).setOngoing(true)
.setContentIntent(pendingIntent);
notificationManager.notify(9999, builder.build());
編輯代碼,2個問題,PendingIntent和NotificationManager。任何更好的通知方式
見編輯的代碼,我有兩個問題 - 1 - 的PendingIntent不能被解析爲一個變量 - 2 - notificationManager無法解析 – DAVIDBALAS1
節省您的源代碼以創建PendingIntent和NotificationManager實例。 – Joseph