Android notification
来源:互联网 发布:淘宝流量高峰期查询 编辑:程序博客网 时间:2024/05/18 01:56
NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);// 实例notification 表示通知的具体内容Notification notification = new Notification(R.drawable.ic_launcher,"我是一个通知", System.currentTimeMillis());// 点击通知后依然显示,另外还可以设置通知不能被清除等等notification.flags = Notification.FLAG_INSISTENT;// 点击这个通知后会转到电话拨打Intent intent = new Intent();intent.setAction(Intent.ACTION_CALL);intent.setData(Uri.parse("tel:123"));PendingIntent contentIntent = PendingIntent.getActivity(this, 0,intent, 0);notification.setLatestEventInfo(this, "我是通知的标题", "我是通知的文本",contentIntent);// 这种写法只能在版本3.0以上才可以使用// Notification.Builder builder = new Builder(this);// builder.setContentTitle("我是通知的标题")// .setContentText("我是通知的文本")// .setSmallIcon(R.drawable.ic_launcher)// .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher));// Notification notification = builder.build();manager.notify(0, notification);
0 0
- ANdroid Notification
- android notification
- android notification
- android notification
- Android Notification
- android notification
- android notification
- android Notification
- Android Notification
- android Notification
- Android notification
- android Notification
- android:Notification
- Android Notification
- Android Notification
- Android Notification
- Android notification
- android Notification
- 循序渐进实现仿QQ界面(二):贴图按钮的三态模拟
- 打印,无选择打印框
- 浏览器的User Agent Stylesheet
- 未来十年营销主流趋势:微信营销
- 循序渐进实现仿QQ界面(三):界面调色与控件自绘
- Android notification
- opencv结构介绍
- Struts2的配置所需jar包
- 循序渐进实现仿QQ界面(四):圆形按钮与工具栏自绘
- Bootstrap
- 监控工程安装常见问题解决方案
- Node.js+npm安装
- 小顶堆排序的实现
- 广告营销项目知识点总结