音乐播放时在通知栏显示大小不同的 notification
2013-07-16 17:36
134 查看
// 创建 remote 对象,一个普通的,一个展开的,remoteViews 的layout有特殊要求,看看文档
RemoteViews views = new RemoteViews(getPackageName(), R.layout.status_bar);
RemoteViews bigViews = new RemoteViews(getPackageName(), R.layout.status_bar_expanded);
status =
new Notification.Builder(this).build();
status.contentView = views;
status.bigContentView = bigViews;
status.flags = Notification.FLAG_ONGOING_EVENT;
status.icon = R.drawable.stat_notify_music; // 一定要写,否则通知栏就不出现 notification
status.contentIntent = PendingIntent
.getActivity(this, 0,
new Intent("com.andrew.apolloMod.PLAYBACK_VIEWER")
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0);
startForeground(PLAYBACKSERVICE_STATUS,
status);
RemoteViews views = new RemoteViews(getPackageName(), R.layout.status_bar);
RemoteViews bigViews = new RemoteViews(getPackageName(), R.layout.status_bar_expanded);
status =
new Notification.Builder(this).build();
status.contentView = views;
status.bigContentView = bigViews;
status.flags = Notification.FLAG_ONGOING_EVENT;
status.icon = R.drawable.stat_notify_music; // 一定要写,否则通知栏就不出现 notification
status.contentIntent = PendingIntent
.getActivity(this, 0,
new Intent("com.andrew.apolloMod.PLAYBACK_VIEWER")
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0);
startForeground(PLAYBACKSERVICE_STATUS,
status);
相关文章推荐
- 通知栏Notification在不同手机上显示的问题总结
- 手机影音第十五天,利用service实现后台播放音乐,在通知栏显示当前音乐信息等
- 小弟需要一个能显示播放音频的各频率音量大小(不知道叫什么东东)的控件~!
- NotificationMangerService处理显示通知
- Android音乐播放器---实现Notification控制音乐播放
- 在notification显示音乐图标,设置图标背景的方法
- 关于Android Notification.Builder不显示通知的问题
- Android 自定义通知Notification 适配不同背景颜色
- iOS音乐后台播放及锁屏信息显示
- android中textview的文字处理--同一段文字部分文字作高亮或者显示不同大小等
- IOS锁屏状态播放音乐时显示专辑信息和图片
- textview显示不同颜色不同大小
- Android不同分辨率图片实际显示大小的计算
- 使用Notification通知来显示接收的短信内容
- Android开发:notification通知以及通知不显示的问题
- 在notification显示音乐图标,设置图标背景的方法
- 根据屏幕大小显示不同的字
- Android应用程序当中GridView显示不同大小图片时Item挤出问题解决办法
- Android----Intent,运用由android系统帮助匹配实现打电话、发送短信、打开网页、播放音乐、打开视频、打开图片、安装APK、通知栏消息、拍照上传头像等功能
- 用酷狗播放音乐时,会显示在msn的头像旁边