I want to get a absolute path from URI path using createChooser. What I have to do? If you know a solution that solve this problem, pls, inform me. by the way, URI path display follow path:
content://com.android.providers.media.documents/document/audio%3A38
Normal path display follow path:
/document/audio:38
Here is My Code:
public void set_music_path(View view) {
Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "음악을 선택해주세요."), 1);
}
protected void onActivityResult(int req, int res, Intent data){
super.onActivityResult(req, res, data);
Uri uri = data.getData();
Toast.makeText(this, uri.toString(), Toast.LENGTH_SHORT).show();
Toast.makeText(this, uri.getPath().toString(), Toast.LENGTH_SHORT).show();
}
I'm a Korean student, so there are some grammar errors. if there are grammar errors, overlook my faults