java.lang.SecurityException:权限拒绝:来自pid = 1484,uid = 10151(需要uid = 1000)的getIntentSender() [英] java.lang.SecurityException: Permission Denial: getIntentSender() from pid=1484, uid=10151, (need uid=1000)

查看:267
本文介绍了java.lang.SecurityException:权限拒绝:来自pid = 1484,uid = 10151(需要uid = 1000)的getIntentSender()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Android 4.4.2

I am getting this error specifically on HTC DESIRE 626GPLUS DUAL SIM with Android 4.4.2


java.lang.SecurityException: Permission Denial: getIntentSender() from pid=1484, uid=10151, (need uid=1000) is not allowed to send as package android
       at android.os.Parcel.readException(Parcel.java:1472)
       at android.os.Parcel.readException(Parcel.java:1426)
       at android.app.INotificationManager$Stub$Proxy.cancelAllNotifications(INotificationManager.java:271)
       at android.app.NotificationManager.cancelAll(NotificationManager.java:220)
       at com.bakar.GcmIntentService.onHandleIntent(GcmIntentService.java:92)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:193)
       at android.os.HandlerThread.run(HandlerThread.java:61)

推荐答案

尝试将try-catch添加到您的代码中,如下所示:

Try adding a try-catch to your code, like this :

NotificationManager nMgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
try {
    nMgr.cancelAll();
} catch (Exception e) {
    e.printStackTrace();
}

您提到的设备型号可能不支持

作为cancelAll().

as cancelAll() may not be supported by the device model you mentioned.

这篇关于java.lang.SecurityException:权限拒绝:来自pid = 1484,uid = 10151(需要uid = 1000)的getIntentSender()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆