下载此文档

android之Notification通知.doc


文档分类:IT计算机 | 页数:约7页 举报非法文档有奖
1/7
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/7 下载此文档
文档列表 文档介绍
android之Notification通知
http://my./monsieurchak/archive/
我们在用手机的时候,如果来了短信,而我们没有点击查看的话,是不是在手机的最上边的状态栏里有一个短信的小图标提示啊?你是不是也想实现这种功能呢?今天的Notification就是解决这个问题的。
.;
import ;
import ;
import ;
import ;
import ;
import ;
import .Uri;
import ;
import ;
import ;
import ;
/***
* ***@description 状态栏通知相关
* ***@author chenzheng_java
*
*/
public class NotificationActivity extends Activity {
***@Override
protected void onCreate(Bundle savedInstanceState) {
(savedInstanceState);
setContentView();
Button button = (Button) findViewById();
(new () {
***@Override
public void onClick(View v) {
addNotificaction();
}
});
}
/**
* 添加一个notification
*/
private void addNotificaction() {
NotificationManager manager = (NotificationManager) this
.getSystemService();
// 创建一个Notification
Notification notification = new Notification();
// 设置显示在手机最上边的状态栏的图标
= ;
// 当当前的notification被放到状态栏上的时候,提示内容
notif

android之Notification通知 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数7
  • 收藏数0 收藏
  • 顶次数0
  • 上传人luciferios06
  • 文件大小96 KB
  • 时间2017-08-02
最近更新