Q: Setting image using Imagepath does not work Trying to set images to image view using the image paths.
My image path 
   String img_path ="/storage/sdcard0/Fbt/xylo.jpg"; 

image path code 
              private String getRealPathFromURI(Uri contentURI) {
    Cursor cursor = getContentResolver().query(contentURI, null, null, null, null);
    if (cursor == null) { // Source is Dropbox or other similar local file path
        return contentURI.getPath();
    } else { 
        cursor.moveToFirst(); 
        int idx = cursor.getColumnIndex(MediaStore.Images.Media.DATA); 
        return cursor.getString(idx); 
    }
}

    selectedImage = imageReturnedIntent.getData();
            File imageFile = new File(getRealPathFromURI(selectedImage));
           String path= imageFile.toString();

output =/storage/sdcard0/Fbt/xylo.jpg
I tried all possible code still there is no success


*

* ImageView carpict =(ImageView)findViewById(R.id.img);


 Bitmap bitmap = BitmapFactory.decodeFile(img_path);
 carpict.setImageBitmap(bitmap);

2.
       Uri image22 =(Uri.parse(Environment.getExternalStorageDirectory().getAbsolutePath()+img_path));


       InputStream imageStream = null;

            try {
                imageStream = getContentResolver().openInputStream(image22);

                Bitmap carpic = BitmapFactory.decodeStream(imageStream);


               // carpic = Bitmap.createScaledBitmap(carpic, 72,72, false); 
                carpict.setImageBitmap(carpic);
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

3rd.   
          carpict.setImageURI
            (Uri.parse(Environment.getExternalStorageDirectory().getAbsolutePath()+img_path));

4th.
   File imgFile =new File("img_path");
 carpict.setImageBitmap(BitmapFactory.decodeFile(imgFile.getAbsolutePath()));

I have also added         
     <uses-permission   android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

can anyone tell me where i am going wrong?

A: try this code 
ImageView imageView = (ImageView) findViewById(R.id.imageView1);
        System.out.println("sdcard path:"+Environment.getExternalStorageDirectory());
        Drawable d = Drawable.createFromPath(Environment.getExternalStorageDirectory()+"/images.png");
        imageView.setBackground(d);


A: 
imageView.setImageURI(Uri.parse(new File("PathToFile"));

or if you have the file reference:

File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()
                      +"/Fleet/xylo.jpg");


imageView.setImageURI(Uri.parse(file));

This should work. You will need to use the file constructor version of Uri.parse to correctly set the image.
Do check if the image is present in this location, or if the image is valid. And please post the logs if this also doesn't work.

A: The problem was with the image itself when i tried with other images it worked  images with formats .jpg .png  .jpeg 
     ImageView carpict =(ImageView)findViewById(R.id.img);
     Bitmap bitmap = BitmapFactory.decodeFile(img_path);
     carpict.setImageBitmap(bitmap);

Here is the image xylo.jpg which is not getting set, don't know why 
http://www.mediafire.com/?lh75aco1en8f3ot

A: Stirng path="///storage/sdcard0/Android/data/com.package.name/files/Download/Images/one-3.jpg"; //chang with your image file path
File file  = new File(path);
imageView.setImageURI(Uri.parse(file.getPath()));
