In my android application I have used Google drive to pick images and files, for files my code is working perfectly most of the time. Unfortunately in some cases image import is not working, image bitmap is returning null value, below is the code which I have used to convert content URI to input stream and bitmap.
Bitmap bitmap = null;
InputStream input = null;
try {
input = getActivity()
.getContentResolver()
.openInputStream(
Uri.parse("content://com.google.android.apps.docs.storage/document/acc%3D2%3Bdoc%3D83"));
Log.Logger()
.finest("Profileimagefile Fragment Drive called input" + input);
bitmap = BitmapFactory
.decodeStream(input);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
I have mentioned the URI which is not working, kindly help me to figure out the issue.