I am using the code provided by aFileChooser to get able to get the shared image inside my application. Images from the gallery work OK but if i use an image say inside Google C
You cannot and should not attempt to ever get the underlying path corresponding with a URI - in the vast majority of cases your app will never have access to the path itself, but only through the URI.
Thankfully, you can get the binary data of the image from the URI directly:
InputStream in;
Bitmap bitmap = null;
try {
in = getContentResolver().openInputStream(imageUri);
// You could do anything with the InputStream.
// Here we'll just get the Bitmap at full size
bitmap = BitmapFactory.decodeStream(in);
} catch (IOException e) {
// Something went wrong
} finally {
if (in != null) {
try {
in.close();
} catch (IOException ignored) {}
}
}
// Now you have a Bitmap.