0

Possible Duplicate:
Show Image View from file path in android?

here image path is stored as string i want convert the string to image and need to view the image in emulator how is this possible? please tell me

thanks

Community
  • 1
  • 1
tamil
  • 19
  • 8
  • duplicate: http://stackoverflow.com/questions/4181774/show-image-view-from-file-path-in-android – Matthew Mar 10 '11 at 15:48

3 Answers3

0

Use an ImageView and add your string as an resource.

Tobias
  • 7,238
  • 10
  • 46
  • 77
0
Bitmap bm = BitmapFactory.decodeFile(mImagePath);
ImageView image = (ImageView) findViewById(R.id.image_view);
image.setImageBitmap(bm);

Assuming mImagePath is a string that contains your path and R.id.image_view is the ID of an ImageView in your layout.

Good luck!

Will Tate
  • 33,439
  • 9
  • 77
  • 71
0

This answer might help. From that answer:

File imgFile = new  File(“/sdcard/Images/test_image.jpg”);
if(imgFile.exists()){
    Bitmap myBitmap = BitmapFactory.decodeFile(imgFile);
    ImageView myImage = (ImageView) findViewById(R.id.imageviewTest);
    myImage.setImageBitmap(myBitmap);
}
Community
  • 1
  • 1
Matthew
  • 44,826
  • 10
  • 98
  • 87