hi,
I try to read picture from file that save in my computer.
the picture store in this path : C:\Users\naor\Desktop\project\more\home.jpg
and I wrote this code in my application
File imgFile = new File("\ C:\Users\naor\Desktop\project\more\home.jpg");
if(imgFile.exists())
{
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ImageView myImage = (ImageView) findViewById(R.id.view1);
myImage.setVisibility(1);
myImage.setImageBitmap(myBitmap);
}
and when the program running it's not get inside to the if (these mean that imgFile.exists() is false)
I think that the problem is my path maybe it's not write good.
(I tried with / )
please your help
thanks
I try to read picture from file that save in my computer.
the picture store in this path : C:\Users\naor\Desktop\project\more\home.jpg
and I wrote this code in my application
File imgFile = new File("\ C:\Users\naor\Desktop\project\more\home.jpg");
if(imgFile.exists())
{
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ImageView myImage = (ImageView) findViewById(R.id.view1);
myImage.setVisibility(1);
myImage.setImageBitmap(myBitmap);
}
and when the program running it's not get inside to the if (these mean that imgFile.exists() is false)
I think that the problem is my path maybe it's not write good.
(I tried with / )
please your help
thanks