android - 错误:不兼容的类型:Intent 无法转换为 Intent[]
问题描述
我正在为我的 android 应用程序创建一个持久通知通道,因为谷歌宣布你不能在上述版本上运行你的 android 应用程序而不是 oreo,所以我安装了所有最新的 sdk android api 工具包,现在我还需要创建持久通知
但是当我创建通知并运行此代码时,我收到此错误,实际上我想显示完整的错误
错误:不兼容的类型:Intent 无法转换为 Intent[] PendingIntent pendingIntent = PendingIntent.getActivities(this,0, intent1, 0);
解决方案
你应该使用 PendingIntent.getActivity 而不是 PendingIntent.getActivities
推荐阅读
- c# - 无法解密不以“=”结尾的文本
- algorithm - 如何以最佳时间复杂度有效地解决这个问题?
- amazon-web-services - 如何从命令行获取与当前应用程序不同的应用程序中的 Elastic Beanstalk 环境的日志?
- ios - 模态视图控制器子视图
- java - 如何从 Clojure 中的类调用具体化的 Java 接口?通话无法解决
- javascript - 如何遍历 html 块内的 javascript 变量?
- c# - 双击时 TreeNode 被识别为 TreeView
- c# - 将 TempData 与 Post Redirect Get 模式一起使用
- java - Android:在 Firestore 中更改 ArrayList 值?
- javascript - 带有服务器时间的预定事件时间的JavaScript函数?