I am trying to get the content type of a local file on my Android device. My code
File file = new File(uploadPath.replace("file://","")); Uri uri = Uri.fromFile(file); ContentResolver contentResolver = getApplicationContext().getContentResolver(); String type = contentResolver.getType(uri);
My download path is file:///storage/emulated/0/DCIM/Camera/20141016_181148.jpg . However, I always get my type as null. Why is this??
android
iRavi iVooda
source share