我創建的通知是這樣的:的Android 4.0.3的通知缺少操作
NotificationManager notifyManager = (NotificationManager) App
.getContext().getSystemService(Context.NOTIFICATION_SERVICE);
NotificationCompat.Builder builder = new NotificationCompat.Builder(
App.getContext());
builder.setSmallIcon(R.drawable.ic_launcher);
builder.setContentTitle(task.getFileNode().getName());
Intent cancelIntent = CancelDownloadReceiver
.getCancelDownloadIntent(ticketUUID);
PendingIntent intent = PendingIntent.getBroadcast(
App.getContext(), 0, cancelIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
builder.addAction(
R.drawable.ic_stat_cancel,
App.getContext().getString(
R.string.notification_download_cancel),
intent);
builder.setProgress(0, 0, true);
Notification notification = builder.build();
notification.flags = Notification.FLAG_ONGOING_EVENT;
notifyManager.notify(ticketUUID, 1, notification);
問題是,摩托羅拉XOOM採用Android 4.0.3缺少操作。爲什麼?正如你所看到的,我正在使用支持庫中的類。
你的問題是什麼? –
提到的設備上缺少通知中的@SimplePlan操作按鈕。在具有4.2.2 +的仿真器上出現(沒有檢查4.1版本)。我知道它是API 16功能,但我使用的支持庫,所以它必須工作。 – Lingviston