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