I want to convert file:///storage/sdcard0/blue.jpg to content://media/external/images/media/3163 in android

view story

http://stackoverflow.com – I want to upload image, audio and video files from my app. If I select image using Gallery (content://media/external/images/media/3163) it works fine, but if I select using File Manager (file:///storage/sdcard0/blue.jpg) it is not working. uri=intent.getData(); String[] filePathColumn = { MediaStore.Images.ImageColumns.DATA }; if (uri != null) { Cursor cursor = RootActivity.rootContext.getContentResolver().query(Uri.parse(uri), filePathColumn, null, null, null); } The cursor returns null if uri = file:///storage/sdcard0/blue.jpg, can any one help me? Thanks in advance (HowTos)