我正在尝试像这样自定义 android 通知。
Above 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);
最佳答案
关于android - Action 按钮在 Android 通知中不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41952369/