anroid Notification消息通知
来源:互联网 发布:亚克力 吸塑 知乎 编辑:程序博客网 时间:2024/04/29 06:52
public class MessageShowUtil {
private NotificationManager manager;
private Intent intent;
private PendingIntent pendingIntent;
private Notification notification;
private Context context;
public MessageShowUtil(Context context)
{
this.context=context;
//创建NotificationManager 实例
manager=(NotificationManager)context.getSystemService(android.content.Context.NOTIFICATION_SERVICE);
}
public void showMessage()
{
//创建Intent
intent = new Intent(context, MainActivity.class);
//点击通知的时候跳转Activity
pendingIntent = PendingIntent.getActivity(context, 0,intent, 0);
//创建消息
notification=new Notification();
//设置通知在状态栏显示的图标
notification.icon = R.drawable.icon;
//当我们点击通知时显示的内容
notification.tickerText = "開始登陸系統...........";
//通知时发出默认的声音
notification.defaults = Notification.DEFAULT_SOUND;
//设置通知显示的参数
//设置消息显示内容
notification.setLatestEventInfo(context, "公司信息", "点击查看信息!", pendingIntent);
//发布消息
manager.notify(0, notification);
}
}
我是这么理解的,呵呵
- anroid Notification消息通知
- Android 消息通知-Notification
- Android 消息通知-Notification
- Notification实现消息通知
- js消息通知Notification
- AnRoid Notification
- Android 中的消息通知Notification
- 消息栏通知(Notification)介绍
- 消息栏通知(Notification)介绍
- Android的消息通知--Notification
- 消息栏通知(Notification)介绍
- Android的消息通知--Notification
- 使用Notification发送消息通知
- 通知栏消息提醒--notification
- 消息栏通知(Notification)介绍
- Android Notification通知栏消息
- laravel消息Notification邮件通知
- Notification消息通知 通知栏的实现
- boost python 多线程 纠结的一些问题
- 笔记本蓝屏及提示iastor.sys的处理
- 数字矩阵和模拟矩阵
- PWM定时器
- 从3D打印机畅想未来的COPY技术
- anroid Notification消息通知
- ZOJ 1457Prime Ring Problem
- C语言中auto,register,static,const,volatile的区别
- OpenLayers-------地图表现
- 跟我一起写 Makefile
- C++ 友元的优缺点
- 全国最名贵的11种螃蟹 你都吃过了吗
- VC调试——看汇编看内存,从本质上理解C指针
- dos下不能打中文解决方案