我想让一个应用产生通知栏,但是通知栏上不显示图标。下拉通知栏后在信息栏上有我的通知。不知道怎么实现。(有个叫游戏管家的软件实现了,所以问问大牛)
Notification notification = new Notification(icon, "游戏提醒",
System.currentTimeMillis());// 创建Notifcation
就是不要这个icon~
先谢谢了。
Notification notification = new Notification(icon, "游戏提醒",
System.currentTimeMillis());// 创建Notifcation
就是不要这个icon~
先谢谢了。
解决方案 »
- TabWidget类找不到(The following classes could not be found:- TabWidget)
- Activity模拟器横竖屏转换的问题
- android软件蓝牙通信
- 关于按钮按下和按上的问题
- 安装androidADT时的问题,求高手解决,我还是初学者
- android 源码编译失败
- 请教WebService:Android平台下如何自动生成代码,及其异步网络请求
- android 用按钮控制滚动的效果如何实现?
- 监听网络状态,断网时报错:无法实例化该对象
- 为什么sqlLite创不了表,代码在下面,求大神帮我看看
- android Bitmap 生成 单色位的 bmp格式图片文件
- 求助:android怎样实现静默卸载?
换icon,你自己指定嘛
至于Gmail中是如何实现的,我以前也反编译代码,但是代码编译过来非常不好读,很多地方都是错乱的,而且当时时间也有限,并没有看出他具体是如何实现出来的。但是肯定不是我上面说的那个偏激的方法。
RemoteViews contentView = new RemoteViews(context.getPackageName(), R.layout.notification);
然后制定contentView,代码如下:
notification.contentView = contentView;
接下来你想要怎样到notification,就自己在R.layout.notification里自己布局
在notify前添加notification.flags|=Notification.FLAG_AUTO_CANCEL;//自动取消
这样在通知栏就不会有东西显示了