首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >MediaStore.Images.Media.getBitmap在通知大图标中返回System.err

MediaStore.Images.Media.getBitmap在通知大图标中返回System.err
EN

Stack Overflow用户
提问于 2015-11-10 15:31:18
回答 1查看 4.3K关注 0票数 0

我正在制作无线电应用程序,它使用的是大喊广播流。除了在通知大图标上显示播放轨道的艺术品外,我的应用程序一切都很好。我想用里的艺术品。但它从来没有展示过巨无霸的艺术品。这是原木

11-10 17:28:58.624 21627-21627/*我/艺术品: /storage/emulated/0/******/Radio/artworks/fb7fb1d9ad.jpg 11-10 17:28:58.628 21627-21627/* W/System.err: at * .Radyo.nowPlayingN(Radyo.java:684)

代码语言:javascript
复制
if(uri==null) {
                Bitmap Largeicon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher_for_radio);
                notification.setLargeIcon(Largeicon);
            }else {
                try {
                    Log.i("Artwork", uri);
                    Bitmap SavedArtwork = MediaStore.Images.Media.getBitmap(this.getContentResolver(), Uri.parse(uri));
                    notification.setLargeIcon(SavedArtwork);
                } catch (IOException e) {
                    notification.setLargeIcon(BitmapFactory.decodeResource(this.getResources(),R.mipmap.ic_launcher_for_radio));
                    e.printStackTrace();
                }
            }
EN

回答 1

Stack Overflow用户

发布于 2015-11-19 21:43:39

我用这个解决了问题

代码语言:javascript
复制
Bitmap SavedArtwork = MediaStore.Images.Media.getBitmap(this.getContentResolver(), Uri.parse("file://"+uri));
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33633621

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档