Time: 2016-4-20-11:07:29
No response when using Notifaction.builder (), do you want to set icons icon?
builder.setSmallIcon(R.drawable.ic_launcher);
If the icon is not set, there will be no response when the trigger occurs.
Full code style:
Intent intent = new Intent(context, XXActivity.class);
intent.putExtra("recFile", recName);
pendingintent Span class= "PLN" > pendingintent = Pendingintent getactivity ( context Span class= "lit" >0 intent Span class= "PLN" > pendingintent flag_update_current
notificationmanager manager = ( notificationmanager ) context getsystemservice context notification_service
Notification.Builder builder = new Notification.Builder(context);
builder.setTicker("新的通知");
builder.setSmallIcon(R.drawable.ic_launcher);
builder.setContentTitle("收到新的通知");
builder.setContentText("您有一条新的通知");
builder.setContentIntent(pendingIntent);
Notification notification = builder.build();
notification.flags = Notification.FLAG_AUTO_CANCEL;
manager.notify(NOTIFACTION_FLAG_CODE, notification);
From for notes (Wiz)
No response using Notifaction in Android