Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将把音频文件下载到设备的内存中。稍后我想用 MediaPlayer 播放这个音频。在开发者网站上的“媒体播放”指南中,它提到了使用“URI”。有什么办法可以只使用内部存储器中文件的文件名吗?如何播放保存的音频?
To get the URI from a file path this may help:
it looks like
Uri.parse(new File("/sdcard/cats.jpg").toString()) should do the trick.