安卓开发中的notification问题

notification不能用,
notification.setLatestEventInfo(context, "手机卫士", "保护中", pendingIntent);
代码中的setlatestEventinfo出错
很急,求大神解决

http://www.2cto.com/kf/201502/374946.html

应该是上下文没写好
context改为 this 或你定义的Activity类名.this,例如你的Activity命名为Notification,代码可以改为:
notification.setLatestEventInfo(this, "手机卫士", "保护中", pendingIntent);
或 notification.setLatestEventInfo(Notification.this, "手机卫士", "保护中", pendingIntent);

http://blog.csdn.net/illusion_luna/article/details/8122259
见中间部分的代码 40及43行

你可以使用

 NotificationCompat

类来写。

http://www.oschina.net/code/snippet_270292_14489 先简单是不是二楼所说的问题