October 26, 2024
Chicago 12, Melborne City, USA
Android

android dialog box for picking one video with long filenames


android dialog box for video with long filenames

I want to use a dialog box to pick up a video. But these videos have very long filenames and possibly only differ for the several ending characters.
I try two methods but it depends on the versions how android build-in the dialog box (eg. gallery) and may not display the filenames fully.

Are there more solutions? Best if it can also display the video preview.

1.
intent = createBaseFileIntent(Intent.ACTION_OPEN_DOCUMENT, pickerInitialUri);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("video/*");
intent.putExtra(Intent.EXTRA_MIME_TYPES, Utils.supportedMimeTypesVideo);

2.
intent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("/");
intent.putExtra(Intent.EXTRA_MIME_TYPES, new String[]{"image/jpeg", "image/png", "video/mp4", "video/quicktime"});



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video