操作按钮在android通知中不可见

操作按钮在android通知中不可见,android,android-notifications,Android,Android Notifications,我正在尝试像这样定制android通知 对于以上API23,一切正常。下面的API23操作按钮不可见。我找不到我的代码有什么问题 以下是我的API23示例代码: RemoteViews expandedView = createMultiRemoteViews(context, R.layout.notification_multiview_b23, icon, "Custom notification", "This is a custom layout",

我正在尝试像这样定制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);

API 24以下的通知操作不可用。这可能是一个兼容性问题。要支持向后兼容性,请使用支持库的NotificationComapt类。
以下是官方文档和支持库类的链接。

您尝试过哪种android版本?说它在安卓4之前不起作用。1@rala我试过Android版本6.0.1,我的minSDK版本是16。我使用了NotificationCompact类。@khaleel_jageer“并非所有通知功能都适用于特定版本,即使设置它们的方法位于支持库类NotificationCompat.Builder中。例如,依赖于扩展通知的操作按钮仅出现在Android 4.1及更高版本上,因为扩展通知本身仅在Android 4.1及更高版本上可用。”