hi sir
i am implementing this code i got image uri how can read data in imagepath in sdcard
String inFileType = ".jpg";
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b1 = (Button) findViewById(R.id.Button01);
b1.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{
// TODO Auto-generated method stub
startActivityForResult(new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI), 1);
}
});
}
public void onActivityResult(int requestCode,int resultCode,Intent data)
{
super.onActivityResult(requestCode, resultCode,data);
if (resultCode == Activity.RESULT_OK)
{ Uri selectedImage = data.getData();
Cursor cur = Upload.this.managedQuery(selectedImage, null, null, null, null);
if(cur.moveToFirst())
{
try
{ byte[]buffer = null;
System.out.println("1................................");
File Img = new File(selectedImage.getPath()+inFileType);
System.out.println("2............."+Img);
FileInputStream is = null;
try
{
is = new FileInputStream(Img);
is.read(buffer);
BufferedInputStream bis = new BufferedInputStream(is);
Bitmap bm = BitmapFactory.decodeStream(is);
bis.close();
is.close();
System.out.println("3..........."+is);
} catch (FileNotFoundException e) {
Log.d("John: ", "file Not Found");
}
Bitmap bm;
bm = BitmapFactory.decodeStream(is, null, null);
ImageView pic=(ImageView)this.findViewById(R.id.picview);
pic.setImageBitmap(bm);
}
catch (Exception e)
{
// TODO: handle exception
e.printStackTrace();
}
}
}
}
} this code implementing then error file not found how can resolve this problem i am new in android

