title: get image from mySQL to listview Android
body: <p>I want to get an image from my database mySQL to show in listview (image + text listview)</p>
  
  <p>my code : </p>
  
  <pre><code>       public void cek(){
  
             String url_select = "http://10.0.2.2/BloodGlucose/selectDoctor.php";
  
             HttpClient httpClient = new DefaultHttpClient();
             HttpPost httpPost = new HttpPost(url_select);
  
             //parameter
             ArrayList&lt;NameValuePair&gt; param = new ArrayList&lt;NameValuePair&gt;();
  
             try {
                //add parameter
                 httpPost.setEntity(new UrlEncodedFormEntity(param));
  
               HttpResponse httpRespose = httpClient.execute(httpPost);
               HttpEntity httpEntity = httpRespose.getEntity();
  
               //read content
               InputStream in = httpEntity.getContent();
               BufferedReader read = new BufferedReader(new InputStreamReader(in));
  
               String content = "";
               String line = "";
  
               while((line = read.readLine())!=null){
                  content += line;
               }
  
               Log.d("ADBUG", "content: "+content);
  
  
               //json
               if(!content.equals("null")){
  
  
  
  
                  try {
                     JSONArray jArr = new JSONArray(content);
                     for(int i=0;i&lt;jArr.length();i++){
                        JSONObject jObj = jArr.getJSONObject(i);
                        String id = jObj.getString("_id");
                        String name = jObj.getString("name");
                        String dateofbirth = jObj.getString("dateofbirth");
                        String phone = jObj.getString("telp");
                        String address = jObj.getString("clinicaddress");
                        String file = jObj.getString("file");
                        String uname = jObj.getString("username_doctor");
                        String lulusan = jObj.getString("lulusan");
                        String clinicname = jObj.getString("clinicname");
  
                        names.add(name);
                        date.add(dateofbirth);
                        telp.add(phone);      
                        clinic.add(address);
                        usernamedoctor.add(uname);
                        namaklinik.add(clinicname);
                        graduate.add(lulusan);
  
  
  
                     }
  
  
  
  setListAdapter(new DoctorArrayAdapter(this, names)); 
  
                  } catch (JSONException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                  }
  
               }else{
                  Toast.makeText(this, "Error", Toast.LENGTH_LONG).show();
               }
  
            } catch (ClientProtocolException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
            } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
            }
         }
  </code></pre>
  
  <p>DoctorArrayAdapter code:</p>
  
  <pre><code>package research.android.bloodglucose;
  
  
  import java.util.ArrayList;
  
  import research.android.bloodglucose.R;
  
  import android.content.Context;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  public class DoctorArrayAdapter extends ArrayAdapter&lt;String&gt; {
      private final Context context;
      private final ArrayList&lt;String&gt; values;
  
      public DoctorArrayAdapter(Context context, ArrayList&lt;String&gt; names) {
          super(context, R.layout.list_row, names);
          this.context = context;
          this.values = names;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          LayoutInflater inflater = (LayoutInflater) context
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          View rowView = inflater.inflate(R.layout.list_row, parent, false);
          TextView textView = (TextView) rowView.findViewById(R.id.DoctorName);
          ImageView imageView = (ImageView) rowView.findViewById(R.id.list_image);
          textView.setText(values.get(position));
  
          // Change icon based on name
          String s = values.get(position);
  
          System.out.println(s);
  
          /*if (s.equals("WindowsMobile")) {
              imageView.setImageResource(R.drawable.windowsmobile_logo);
          } else if (s.equals("iOS")) {
              imageView.setImageResource(R.drawable.ios_logo);
          } else if (s.equals("Blackberry")) {
              imageView.setImageResource(R.drawable.blackberry_logo);
          } else {
              imageView.setImageResource(R.drawable.android_logo);
          }*/
  
          return rowView;
      }
  }
  </code></pre>
  
  <p>is there any something wrong with my code? because the image didn't show, it's only the text, thank you very much</p>