特定のフォルダのリストビューにビデオのサムネイルとテキストを表示しようとしています。サムネイルを取得していますが、ビデオにテキストを追加し、ContentValuesを使用して更新すると、すべてのビデオのテキストが取得されます。ビデオをカスタムフォルダ「/sdcard/myfolder/」に保存しました。
これは私がキャプチャしたビデオを保存する方法です(カスタムカメラレコーダー):
ContentResolver contentResolver = getContentResolver();
Uri base = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;// how to specify folder
Uri newUri = contentResolver.insert(base, values);
ギャラリーからすべてのビデオを取得しています。フォルダを指定する方法です。
これは私がリストビューの各ビデオにテキストを追加しようとする方法です:
ContentValues values = new ContentValues(1);
values.put(MediaStore.Video.Media.DESCRIPTION, edtext.getText().toString());
//values.put(MediaStore.Video.Media.DATA, videoFile.getAbsolutePath());
ContentResolver contentResolver = getContentResolver();
Uri base = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
contentResolver.update(base, values,null,null);
これにより、すべての動画に同じテキストが追加されます。