通知栏异常 android.app.RemoteServiceException:Bad notifcation for Foreground :java.lang.ClassCastExceptio
来源:互联网 发布:js弹窗代码 编辑:程序博客网 时间:2024/05/20 10:52
通知栏异常,但可以正常使用,主要报错的机型是 SAMAUNG Galaxy SII/SIII/ SAMSUNG GT-i9220 M470BSA。
这个异常属于API异常,意思是你的通知栏需要一个PendingIntent ,这个PendingIntent 指向一个Intent可以做界面跳转,发送广播,开启Service之类的。
有些情况下我们没有在通知栏做跳转到界面之类的操作,可能只是开启手电筒,开启移动网络,蓝牙等操作,这种情况就不需要给Notification设置PendingIntent 大部分的机型是可以的,只有上述提到的机型会异常,我们只需要给设置一个Intent为空的PendingIntent就可以了。
代码:
PendingIntent mPendingIntent = PendingIntent.getActivity(context, 0,new Intent(), PendingIntent.FLAG_CANCEL_CURRENT);mBuilder.setContentIntent(mPendingIntent);
异常截图:
0 0
- 通知栏异常 android.app.RemoteServiceException:Bad notifcation for Foreground :java.lang.ClassCastExceptio
- android.app.RemoteServiceException: Bad notification posted from package 异常解决
- android -----通知(Notifcation)
- 关于错误:android.app.RemoteServiceException: Bad notification posted from package
- android.app.RemoteServiceException: Bad notification posted from package
- 关于错误:android.app.RemoteServiceException: Bad notification posted from package
- 自定义notification布局出现异常:android.app.RemoteServiceException
- Android 自定义样式通知栏的坑RemoteServiceException
- android.app.RemoteServiceException: Bad notification posted from package com.xxx 报错
- java.lang.UnsupportedClassVersionError: Bad version number in .class file异常
- java.lang.UnsupportedClassVersionError: Bad version number in .class file异常
- java.lang.UnsupportedClassVersionError: Bad version number in .class file异常
- java.lang.UnsupportedClassVersionError: Bad version number in .class file异常 .
- 异常备忘:java.lang.UnsupportedClassVersionError: Bad version number
- java.lang.UnsupportedClassVersionError: Bad version number in .class file异常
- java.lang.UnsupportedClassVersionError: Bad version number in .class file异常
- : java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThreadProxy 解决方法
- intent Getting java.lang.SecurityException: Unable to find app for caller android.app.ApplicationThr
- 基于OK-2440III的u-boot移植
- 在一次也没有打开app的情况下能否接受到系统广播
- android 缓存管理及LRU算法
- ASP.Net 2.0窗体身份验证机制详解(FormsAuthentication) (转载)
- 设置 quick-cocos2d-x 在 Mac 下的编译环境
- 通知栏异常 android.app.RemoteServiceException:Bad notifcation for Foreground :java.lang.ClassCastExceptio
- 《Linux内核设计与实现》——下半部和推后执行的工作
- 你想成为一名优秀的程序员吗?
- 获取TCP链接的四元组
- 反射根据变量的引用获取变量名
- 中国残障人童话爱情电影剧本《奇缘奇恋》招募投资人
- USACO Section 1.3 Combination Lock
- UVA11069 - A Graph Problem(DP)
- ImageUtil 工具类