2014-06-15 4 views
2

이 ID의 사용하여 비디오의 URI를 가져옵니다 (미디어 스토어 MediaStore) :안드로이드 CursorAdapter에서과 같이 발견 나는 비디오의 미디어 스토어 MediaStore ID가

Cursor cursor = mGalleryAdapter.getCursor(); 
cursor.moveToPosition(position); 
Integer id = cursor.getInt(cursor.getColumnIndex(MediaStore.Video.Media._ID)); 

은 어떻게 URI를 얻기 위해 ID를 사용할 수 있습니다 동영상을 녹화 할 때 URI가 의 onActivityResult()에 수신되는 것과 유사합니까?

미리 감사드립니다.

답변

1

ID를 공급자 URI에 추가하기 만하면됩니다. 예를 들어 외부 저장소에있는 동영상 파일의 경우 :

Uri vedioUri = Uri.parse(MediaStore.Video.Media.EXTERNAL_CONTENT_URI + "/" + id);