简体   繁体   English

播放列表不是使用contentresolver在EXTERNAL_CONTENT_URI上创建的

[英]playlist is not created on EXTERNAL_CONTENT_URI using contentresolver

I am trying to create a playlist using the following code 我正在尝试使用以下代码创建播放列表

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ContentValues cv = new ContentValues();

        cv.put(MediaStore.Audio.Playlists.NAME, "123456");

        //Uri uri = getContentResolver().insert(MediaStore.Audio.Playlists.getContentUri("external"), cv);
        Uri uri = getContentResolver().insert(MediaStore.Audio.Playlists.EXTERNAL_CONTENT_URI, cv);
        if (uri != null)
        {
            Toast.makeText(getApplicationContext(),uri.toString(), 
                    Toast.LENGTH_LONG).show();
        }
    }

this just would not create any playlist 这只是不会创建任何播放列表

if i try INTERNAL_CONTENT_URI the playlist is created but even the default app for music in my phone would not show new playlist created 如果我尝试INTERNAL_CONTENT_URI,则会创建播放列表,但即使手机中的音乐默认应用也不会显示创建的新播放列表

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

是真正的问题。

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

相关问题 Android中EXTERNAL_CONTENT_URI的文件路径 - Filepath of EXTERNAL_CONTENT_URI in Android 使用EXTERNAL_CONTENT_URI从图库中选择的图像中缺少EXIF信息 - Missing EXIF info in images selected from gallery using EXTERNAL_CONTENT_URI Android:EXTERNAL_CONTENT_URI足够用于照片库吗? - Android: Is EXTERNAL_CONTENT_URI enough for a photo gallery? EXTERNAL_CONTENT_URI和INTERNAL_CONTENT_URI都从Android的内部存储卡中提取视频 - EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI both fetch videos from internal memory card in android 查询 MediaStore.Images.Media ,如何同时查询 EXTERNAL_CONTENT_URI 和 INTERNAL_CONTENT_URI? - Querying MediaStore.Images.Media , how do I query both on EXTERNAL_CONTENT_URI and INTERNAL_CONTENT_URI? ContentResolver 插入 MediaStore.Audio.Media.EXTERNAL_CONTENT_URI 错误 - ContentResolver insert MediaStore.Audio.Media.EXTERNAL_CONTENT_URI error Android使用contentResolver从内容URI获取文件路径 - Android getting file path from content URI using contentResolver Android 9 (Pie) ContentResolver 查询 MediaStore.Images.Media.EXTERNAL_CONTENT_URI 在 api 28 上返回 null - Android 9 (Pie) ContentResolver query MediaStore.Images.Media.EXTERNAL_CONTENT_URI returns null on api 28 如何使用ContentResolver创建新的播放列表 - How to create a new Playlist using ContentResolver 使用ContentResolver来自Uri的文件路径 - File path from Uri using ContentResolver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM