show image from database where you saved the path of image
<p>Hello i have saved in my databse the path of an image .How can i show the image on the screen?The image path is saved in column "photo" in table "contactTest1" !
Now i can show on my screen only the path of image for each contact like this:</p>

<p><img src="http://i.stack.imgur.com/6ujRG.png" alt="enter image description here"></p>

<p>i use this in dbconsole.java:</p>

<pre><code>     private static String[] FROM = { DbConstants.NAME, DbConstants.PHOTO, DbConstants.EMAIL,DbConstants.URL_STRING,DbConstants.ADRESS,DbConstants.PHONE,_ID};
     private static int[] TO ={R.id.name,R.id.edittext1};

     private void showContacts(Cursor cursor) {
       //set up data binding
       SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.item, cursor, FROM, TO);
       setListAdapter(adapter);
</code></pre>

<p>this the code i use to get path of image:</p>

<pre><code>              Button sButton = (Button) findViewById(R.id.button1);
     sButton.setOnClickListener(new OnClickListener() {

          public void onClick(View arg0) {
              // in onCreate or any event where your want the user to
              // select a file
              Intent intent = new Intent();
              intent.setType("image/*");
              intent.setAction(Intent.ACTION_GET_CONTENT);
              startActivityForResult(Intent.createChooser(intent,
                      "Select Picture"), SELECT_PICTURE);
          }
      });




            public void onActivityResult(int requestCode, int resultCode, Intent data) {  
       if (resultCode == RESULT_OK) {
           if (requestCode == 1) {
               // currImageURI is the global variable I'm using to hold the content:// URI of the image
               Uri currImageURI = data.getData();
               getRealPathFromURI(currImageURI);

           }
         }
       }


    public String getRealPathFromURI(Uri currImageURI) {
       // can post image
       String [] proj={MediaStore.Images.Media.DATA};
       Cursor cursor = managedQuery( currImageURI,
               proj, // Which columns to return
               null,       // WHERE clause; which rows to return (all rows)
               null,       // WHERE clause selection arguments (none)
               null); // Order-by clause (ascending by name)
       int column_index =  cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
       cursor.moveToFirst();


          poza=(EditText)findViewById(R.id.editText1);
           poza.setText(currImageURI.toString());
          return cursor.getString(column_index);

    }
</code></pre>
