I am trying to open specific folder using intent since I need to pass the picked data from that folder to my cordova app. Is there any solution for this issue?
Following is the code which I am using currently :-
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/folder_name/");
intent.setDataAndType(Uri.fromFile(file), "resource/folder");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (this.cordova != null)
{
this.cordova.startActivityForResult((CordovaPlugin) this, Intent.createChooser(intent,
new String(title)), (srcType + 1) * 16 + returnType + 1);
}
By this code user first has to select a file explorer upon which the file explorer shows the content of that folder. But my requirement is to directly open the contents of that particular specified folder and to be able to pick the video. Can anybody help me in this?