WEB开发网
开发学院手机开发Android 开发 Android 消息通知 阅读

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

上一页  1 2 

Tags:Android 消息 通知

编辑录入:coldstar [复制链接] [打 印]
赞助商链接