How to get the path of the image downloaded from third party application and stored in sd card
<p>I am trying to open the gallery and select the image from there.I got the path of all the image which are captured from camera but cannot get the real path of the image which were downloaded from Facebook/picassa etc.The path it is giving is like <a href="https://lh3.googleusercontent.com/XNzSBp0MycQ/TigFxMIWn2I/AAAAAAAAAAg/YJPWAWmGOy0/I/11%252520-%2525201.jpg" rel="nofollow">https://lh3.googleusercontent.com/XNzSBp0MycQ/TigFxMIWn2I/AAAAAAAAAAg/YJPWAWmGOy0/I/11%252520-%2525201.jpg</a>  even though it is in gallery.</p>

<p>Here is my code :: </p>

<pre><code>Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE);
</code></pre>

<p>i am using the following code to get the path</p>

<pre><code>                  Uri selectedImageUri = data.getData();
        String selectedImagePath = getPath(selectedImageUri);  

           public String getPath(Uri uri) {

    int columnIndex = 0;
    String[] projection = { MediaColumns.DATA };
    Cursor cursor = managedQuery(uri, projection, null, null, null);
    if (cursor != null) {
        columnIndex = cursor.getColumnIndexOrThrow(MediaColumns.DATA);
        cursor.moveToFirst();
        String imagePath = cursor.getString(columnIndex);
        return imagePath;
    } else {
        return null;
    }
</code></pre>
