首页 > 解决方案 > 错误:不兼容的类型:Intent 无法转换为 Intent[]

问题描述

我正在为我的 android 应用程序创建一个持久通知通道,因为谷歌宣布你不能在上述版本上运行你的 android 应用程序而不是 oreo,所以我安装了所有最新的 sdk android api 工具包,现在我还需要创建持久通知

但是当我创建通知并运行此代码时,我收到此错误,实际上我想显示完整的错误

错误:不兼容的类型:Intent 无法转换为 Intent[] PendingIntent pendingIntent = PendingIntent.getActivities(this,0, intent1, 0);

在此处输入图像描述

标签: androidandroid-intent

解决方案


你应该使用 PendingIntent.getActivity 而不是 PendingIntent.getActivities


推荐阅读