简体   繁体   English

Android中EXTERNAL_CONTENT_URI的文件路径

[英]Filepath of EXTERNAL_CONTENT_URI in Android

I was following this tutorial to create a music player but have hit an obstacle. 我正在按照本教程创建音乐播放器,但遇到了障碍。

I can load up the application all well and good. 我可以很好地加载应用程序。 However, the list is not populated with any music files despite there being music files present in the "music" folder on my SD card inside my phone. 但是,尽管手机内SD卡上“音乐”文件夹中存在音乐文件,但列表中没有任何音乐文件。

ContentResolver musicResolver = getContentResolver();
Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);

Where is the line of code Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; 其中的代码行Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; pointing to in terms of filepath? 指向文件路径?

I've looked it up online but have not found any information on this, just saying that it searches for music files in the external SD card, which is clearly not the case. 我已经在网上查找了它,但没有找到任何相关信息,只是说它在外部SD卡中搜索音乐文件,显然不是这种情况。

Thanks. 谢谢。

It seemed that everything was working and it was a silly oversight on my part. 似乎一切正常,对我而言这是一个愚蠢的疏忽。

The ListView was not visible in the phone's screen. ListView在手机屏幕上不可见。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM