我得到了这个使用图像,如:
Intent intent = new Intent(Intent.ACTION_PICK, null);
intent.setType("image/*");
image = new File(projectPathFull,"testapp_"+imageCounter+".jpg");
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image));
startActivityForResult(intent, REQUEST_PICK_IMAGE);
这会在我的文件夹 testapp 中创建选择的图像,但它不适用于 Audiofiles。这是我的代码:
Intent toAudioSelect = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI);
audio = new File(projectPathFull,"testapp_"+imageCounter+".mp3");
toAudioSelect.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(audio));
startActivityForResult(toAudioSelect, REQUEST_PICK_AUDIO);
有任何想法吗?