android notification
时间:2011-04-17 来源:朱旭东
Intent intent=new Intent(mainActivity.this,mainActivity.class);
PendingIntent pi=PendingIntent.getActivity(mainActivity.this, 0, intent, 0);
Notification myNotification=new Notification();
myNotification.icon=R.drawable.noti;
myNotification.tickerText="点击查看";
myNotification.defaults=Notification.DEFAULT_SOUND;
myNotification.setLatestEventInfo(mainActivity.this, "示例", "点击查看", pi);
NotificationManager notificationManager=(NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(0, myNotification);
相关阅读 更多 +