- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
- 纳金币
- 38268
- 精华
- 111
|
- String scheme = mAudioUri.getScheme();
- String title = "";
- String artist = "";
- if(scheme.equals("content")) {
- String[] proj = {MediaStore.Audio.Media.TITLE, MediaStore.Audio.Media.ARTIST};
- Cursor cursor = this.getContentResolver().query(mAudioUri, proj, null, null, null);
- if(cursor != null && cursor.getCount() > 0) {
- cursor.moveToFirst();
- //unity3d开发:www.unitymanual.com
- if(cursor.getColumnIndex(MediaStore.Audio.Media.TITLE) != -1) {
- title = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.TITLE));
- artist = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Audio.Media.ARTIST));
- }
- }
- }
-
复制代码 * 版权声明:转载时请以超链接形式标明文章原始出处和作者信息
* 本文来自:Unity3D 教程手册
* 本文链接:http://www.unitymanual.com/6994.html
|
|