[英]How to find the song title, artist name in android so that I can display all the attributes separately in my app?
I am trying to create a Media Player
app using the MediaPLayer
class and all that stuff. 我正在尝试使用
MediaPLayer
类和所有这些东西来创建Media Player
应用程序。 I was able to display the song file name in one line. 我能够在一行中显示歌曲文件名。 I am finding it difficult to separate the song title, song name, movie name and display it separately in a
TextView
. 我发现很难分开歌曲标题,歌曲名称,电影名称并将其分别显示在
TextView
。
You needed to search over internet before asking any question. 您需要在问任何问题之前通过互联网搜索。
String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";
String[] projection = { MediaStore.Audio.Media._ID,
MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.TITLE,
MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.DISPLAY_NAME,
MediaStore.Audio.Media.DURATION};
cursor = this.managedQuery(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, projection, selection,null, null);
private List<String> songs = new ArrayList<String>();
while(cursor.moveToNext()){
songs.add(cursor.getString(0) + "||" + cursor.getString(1) + "||" +
cursor.getString(2) + "||" + cursor.getString(3) + "||" +
cursor.getString(4) + "||" + cursor.getString(5));
}
Link To See this ,and this ,and this ,and this for custom listview 链接以查看此 , 此 , 此和此,用于自定义列表视图
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.