gpt4 book ai didi

android - 通知操作按钮外观

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:06:56 25 4
gpt4 key购买 nike

如何使通知按钮按预期显示(如下图中的第 2 个通知)?

这是我的代码:

Notification.Builder nb = new Notification.Builder(mCtx);
nb.setTicker("DATART");
nb.setSmallIcon(R.drawable.ic_menu_info_details_select);
nb.setContentText("DATART text");
nb.setContentTitle(mCtx.getString(R.string.app_name));
nb.setContentIntent(getClickIntent());
nb.setAutoCancel(true);
nb.setDefaults(Notification.DEFAULT_VIBRATE | Notification.DEFAULT_SOUND);
nb.setLights(LED, LEDON, LEDOFF);
nb.addAction(android.R.drawable.ic_btn_speak_now, "Prihodit", PendingIntent.getActivity(mCtx, 0, new Intent(mCtx, AuctionProductDetail.class), 0));
nb.addAction(android.R.drawable.ic_dialog_map, "Mapa", PendingIntent.getActivity(mCtx, 0, new Intent(mCtx, AuctionProductDetail.class), 0));
return nb.build();

Notification

最佳答案

看来我必须将 android:targetSdkVersion 设置为 11 或更高

关于android - 通知操作按钮外观,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11668819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com