我想将基于图像的项目添加到Android TV主屏幕频道。它可以从Web来源运行,但不能从外部存储(存储/模拟)运行。有人遇到过同样的问题吗?
Uri uri = Uri.parse("/storage/emulated/0/Pictures/sample.jpg");
PreviewProgram program = new PreviewProgram.Builder()
.setChannelId( channelId )
.setPosterArtUri(uri)
.setIntentUri( Uri.parse( intent.toUri( Intent.URI_INTENT_SCHEME ) ) )
.setType( TvContractCompat.PreviewPrograms.TYPE_CLIP )
.build();
我知道您可以在项目中使用资源:android.resource:// package / drawable / file
但是,我无法获得file://或什至content://都无法使用。
没有人有针对动态创建的位图的解决方案(除了将其发布到Web服务器并使用https://之外?