Android 消息通知
2010-06-17 03:36:00 来源:WEB开发网核心提示:setLatestEventInfo(Context context, CharSequence contentTitle, CharSequence contentText, PendingIntent contentIntent) 设置Notification留言条的参数writeToParcel(Parcel p
setLatestEventInfo(Context context, CharSequence contentTitle, CharSequence contentText, PendingIntent contentIntent) 设置Notification留言条的参数
writeToParcel(Parcel parcel, int flags) Flatten this notification from a parcel.
toString() …………….
将Notification发送到状态条上:
Notification notification = new Notification(R.drawable.icon,
"Service started", System.currentTimeMillis());
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, Main.class), 0);
// must set this for content view, or will throw a exception
notification.setLatestEventInfo(this, "Test Service",
"Service started", contentIntent);
nm.notify(R.string.hello, notification);
Notification的取消
nm.cancel(R.string.hello);
参考:http://yuanyao.javaeye.com/blog/472332
[]
更多精彩
赞助商链接