ITeye博客

Android开发片段–Notification

04023129 · 2011-12-06 09:01 · Android代码片段 · 移动开发 · Markdown

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);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。