无法解析方法setGroup
问题描述:
我想为setGroup()
的组分配一个通知,用于堆叠通知并进行汇总。无法解析方法setGroup
像HERE
final static String GROUP_KEY_SAPPHIRE = "group_key_emails";
NotificationCompat.Builder oneBuilder = new NotificationCompat.Builder(this);
oneBuilder.setSmallIcon(R.drawable.warning_icon)
.setContentTitle("Warning: ")
.setContentText(message)
.setPriority(0x00000002)
.setLights(Color.GREEN, 500, 500)
.setGroup(GROUP_KEY_SAPPHIRE)
.addAction (R.drawable.ic_action_accept_dark,
getString(R.string.ok), warningPendingIntent);
NotificationManager oneNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
oneNotificationManager.notify(NOTIFICATION_ID, oneBuilder.build());
editText.setText("");
但我总是得到的回应,该方法个setgroup无法解析。 我输入了.v4.support库。
在此先感谢
答
这可能为时已晚,但其他人有问题,像我这样的,你应该更新.v4.support库。至少在Gradle build.gradle应用程序依赖项中支持-v4:21,这种堆叠样式可以从API 21+获得。