android.app.RemoteServiceException: Bad notification posted from package 异常解决

    xiaoxiao2021-12-14  18

    android.app.RemoteServiceException: Bad notification posted from package 异常解决  

    在android4.0一下的版本,使用 noticManager.notify()一个notification 必须要设定一个  pendingintent 不然系统会异常抛出。

    所以在notification初始化前填下如下代码即可   

     

    PendingIntent pendingintent = PendingIntent.getActivity(this, 0, new Intent(), PendingIntent.FLAG_CANCEL_CURRENT);         notification.contentIntent=pendingintent;

    转载请注明原文地址: https://ju.6miu.com/read-963597.html

    最新回复(0)