我试图像这样自定义Android通知。
以上API23的一切正常。对于以下API23操作按钮不可见。我找不到我的代码有什么问题。
这是我的示例代码,适用于以下API23:
RemoteViews expandedView = createMultiRemoteViews(context,
R.layout.notification_multiview_b23, icon, "Custom notification", "This is a custom layout", leftImage, rightImage, "09:10", "16:23");
expandedView.setOnClickPendingIntent(R.id.left_image, leftImageIntent);
expandedView.setOnClickPendingIntent(R.id.right_image, rightImageIntent);
NotificationCompat.Action addToWatchListAction = new NotificationCompat.Action.Builder(R.drawable.ic_bookmark_border_black_24dp,
LABEL_ADD_TO_WATCH_LIST, addToWatchList).build();
NotificationCompat.Builder builder = createNotificationBuider(context, "Custom notification", "This is a custom layout", icon);
builder.addAction(addToWatchListAction);
builder.setCustomBigContentView(expandedView);
showNotification(context, builder.build(), MULTI_NOTI_ID);