在消息中心显示通知,
代码在很多机器上跑都没有问题(公司有专门的qa)。但是跑在4.0.3上就crash.就如下一句会报空指针,
notification.contentIntent = PendingIntent.getActivity(context, 0, null, 0)求大神指点,4.0.3的sdk这里的哪里改了????多谢啊!急

解决方案 »

  1.   

    自己发现了。。第三个参数不能设为null,必须要new Intent(XX,YY)。
    可是我就是想点击消息后哪个activity都不跳转呢。。
    设为new Intent(XXXX, null),也不行唉。为啥4.0之下都可以呢。。
      

  2.   

    解决了吗?我没办法了,绑定了一个service。
    intent.setClass(this, UselessService.class);
    PendingIntent contentIntent = PendingIntent.getService(this, 0, intent, 0);
    notification.contentIntent = contentIntent;
      

  3.   

    pendingintent 的 intent 参数直接 new 一个 空的 intent 就可以了Intent  intent = new Intent();