我正在创建这样的通知:
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的行动缺失。为什么?如您所见,我正在使用支持库中的类。