Hi I have used below code to pick video from gallery
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent = Intent.createChooser(intent, context.getString(R.string.choose_video));
startActivity(activity, fragment, intent, REQUEST_VIDEO_FROM_GALLERY);
private static void startActivity(Activity activity, Fragment fragment, Intent intent, int requestCode) {
if (fragment != null) {
fragment.startActivityForResult(intent, requestCode);
} else {
activity.startActivityForResult(intent, requestCode);
}
}
But its not only showing the local video's like in WhatsApp Messenger, when opening gallery. I'm in need to restrict to show only local video while opening gallery like in WhatsApp Messenger. Please suggest me some idea.
I have also tried EXTRA_LOCAL_ONLY only like in below mentioned link. It shows local videos, but it also shows other documents.
Android : Why Intent.EXTRA_LOCAL_ONLY shows Google Photos
Can any one please suggest me an idea to show the local video when picking video from gallery using intent? Thanks in advance.