I am trying to write an app allows user to read a note with picture in it. Right now I have a problem about how to import an image file from the phone and add it in the edit window(EditText). The number of the images is not fixed. Is there someone who can help me? Thanks!
preguntado el 10 de marzo de 12 a las 16:03
First, you cannot display an image into EditText. You need to use ImageView for it. You can read image file and convert it into bitmap and give bitmap object as source of imageview. You can find out more for ImageView
Give some more explanation what exactly you want to do, so i can help you better. However this can be helpful to you.
String imageFilePath; ImageView clicked_pic; imageFilePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/gps_123.png"; // path to an image which is stored in the sd-card. Bitmap imgg = BitmapFactory.decodeFile(imageFilePath); clicked_pic.setImageBitmap(imgg); // set image to imageview.