大佬教程收集整理的这篇文章主要介绍了Android NotificationListenerService抛出DeadObjectException,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
E/Notificationservice﹕ unable to notify listener (posted): android.service.notification.INotificationListener$stub$Proxy@42c047a0 android.os.DeadObjectException at android.os.binderProxy.transact(Native Method) at android.service.notification.INotificationListener$stub$Proxy.onNotificationPosted(INotificationListener.java:102) at com.android.server.notificationmanagerservice$NotificationListenerInfo.notifyPostedIfUserMatch(notificationmanagerservice.java:241) at com.android.server.notificationmanagerservice$2.run(notificationmanagerservice.java:814) at android.os.Handler.handleCallBACk(Handler.java:730) at android.os.Handler.dispatchmessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at com.android.server.ServerThread.run(SystemServer.java:1000)
这就是我启动服务的方式
@Override public Boolean onOptionsItemSELEcted(MenuItem item) { switch (item.getItemId()) { case R.id.action_start_service: startservice(new Intent(this,Connectservice.class)); return true; default: return super.onOptionsItemSELEcted(item); } }
我可以验证服务是否启动,因为我登录了onCreate()和onDestroy().
以下是如何处理通知发布的方式:
@Override public void onNotificationPosted(StatusBarNotification sbn) { Log.i(tag,sbn.getNotification().toString()); if (sbn != null && sbn.getPackagename().equalsIgnoreCase(PKG)) { Intent intent = new Intent(Connectservice.NOTIFY); intent.putExtra("notification",sbn.getNotification().toString()); bManager.sendBroadcast(intent); } }
糟糕的是堆栈跟踪是没用的.出了什么问题?
以上是大佬教程为你收集整理的Android NotificationListenerService抛出DeadObjectException全部内容,希望文章能够帮你解决Android NotificationListenerService抛出DeadObjectException所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。