坤乾_老毛 2015-07-16 02:28 采纳率: 0%
浏览 3010

信鸽推送时,关于状态栏显示消息的两个问题

信鸽推送,会在通知栏上显示消息。
现在的问题是:
1、点击通知栏的消息,程序会崩溃。报错log如下。
07-15 18:32:06.779: E/ZTEGesture(1087): ViewRootGestureDispatcher bindService Fail
07-15 18:32:06.789: E/ActivityThread(1087): Activity com.activity.Login has leaked ServiceConnection android.view.ViewRootGestureDispatcher$1@41986228 that was originally bound here
07-15 18:32:06.789: E/ActivityThread(1087): android.app.ServiceConnectionLeaked: Activity com.activity.Login has leaked ServiceConnection android.view.ViewRootGestureDispatcher$1@41986228 that was originally bound here
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.LoadedApk$ServiceDispatcher.(LoadedApk.java:965)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:859)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ContextImpl.bindService(ContextImpl.java:1260)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ContextImpl.bindService(ContextImpl.java:1252)
07-15 18:32:06.789: E/ActivityThread(1087): at android.content.ContextWrapper.bindService(ContextWrapper.java:394)
07-15 18:32:06.789: E/ActivityThread(1087): at android.view.ViewRootGestureDispatcher.(ViewRootGestureDispatcher.java:32)
07-15 18:32:06.789: E/ActivityThread(1087): at android.view.ViewRootImpl.(ViewRootImpl.java:415)
07-15 18:32:06.789: E/ActivityThread(1087): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:292)
07-15 18:32:06.789: E/ActivityThread(1087): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
07-15 18:32:06.789: E/ActivityThread(1087): at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
07-15 18:32:06.789: E/ActivityThread(1087): at android.view.Window$LocalWindowManager.addView(Window.java:547)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2646)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2097)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ActivityThread.access$600(ActivityThread.java:133)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1203)
07-15 18:32:06.789: E/ActivityThread(1087): at android.os.Handler.dispatchMessage(Handler.java:99)
07-15 18:32:06.789: E/ActivityThread(1087): at android.os.Looper.loop(Looper.java:137)
07-15 18:32:06.789: E/ActivityThread(1087): at android.app.ActivityThread.main(ActivityThread.java:4794)
07-15 18:32:06.789: E/ActivityThread(1087): at java.lang.reflect.Method.invokeNative(Native Method)
07-15 18:32:06.789: E/ActivityThread(1087): at java.lang.reflect.Method.invoke(Method.java:511)
07-15 18:32:06.789: E/ActivityThread(1087): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
07-15 18:32:06.789: E/ActivityThread(1087): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
07-15 18:32:06.789: E/ActivityThread(1087): at dalvik.system.NativeStart.main(Native Method)

2、我想隐藏状态栏的推送信息,不让它显示,有没有什么方法。
我在onNotifactionShowedResult回调方法的最后一行,使用了
XGPushManager.clearLocalNotifications(context);
XGPushManager.deleteTag(context, CommData.TAG_TYPE);
NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancelAll();
这几句话,完全没有效果啊

  • 写回答

4条回答 默认 最新

  • bdmh 移动开发领域优质创作者 2015-07-16 02:45
    关注

    可以,继承 XGPushBaseReceiver,但是通知不行,如果是消息,你可以自己控制弹出

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog