首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android开发片断–Notification

2012-06-27 
Android开发片段–NotificationNotificationManager mn ( NotificationManager)context.getSystemService(

Android开发片段–Notification

NotificationManager mn =( NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);notification = new Notification(iconImage,statusBarText, System.currentTimeMillis());notification.defaults |= Notification.DEFAULT_LIGHTS;notification.sound = Uri.parse("android.resource://" + context.getPackageName()+ "/" + R.raw.message);        PendingIntent contentIntent=PendingIntent.getActivity(context,                0, null, 0);        notification.setLatestEventInfo(context,title, content, contentIntent);        mn.notify(1, notification);
?

热点排行