我有以下代码在 C2DMReceiver.java 的通知栏中发出通知。此类本身扩展了 BroadcastReceiver。以下代码在 onReceive 方法中。
NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
int icon = R.drawable.ic_call;
CharSequence text = "Match Found";
CharSequence contentTitle = "Match";
CharSequence contentText = received.getExtras().getString("matches");
long when = System.currentTimeMillis();
Intent intent = new Intent(context, C2DMReceiver.class);
PendingIntent contentIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
Notification notification = new Notification(icon,text,when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notificationManager.notify(34, notification);
现在,当我单击通知栏中的通知时。c2DmReceiver 类的 onReceive 方法未调用。
请帮忙...