I am using the following code to get files from gallery. The file that i retrieve is either image file, video file or an audio file based on user selection.
Now i am displaying the file retrieve from the gallery inside a list view. But i am not able to distinguish that the file selected by the user is image file(i.e .jpg / .png) or its an video file or an audio file.
By getting the extension and checking it in the if else condition its possible i know. But i want to know its there any possible way of doing this
Code used to get image from Gallery is
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
startActivityForResult(intent, GET_VIDEO_AUDIO);
fileTransferDialog.dismiss();