title: How do i get image from imageUrl in imageView
body: <p>How can i get image from image url in image view.<br/>
  My imageUrl is coming from databaseadapter.<br/>
  <br/> In Fields class LocationImage dataype is string but in <strong>setBackgroundResource</strong> method it is asking for int value as parameter. LocationImage url is getting from database, so that i've taken that as string variable.<br/></p>
  
  <p><strong>code lines are here.</strong> </p>
  
  <pre><code>import java.util.ArrayList;
  
  import android.app.ListActivity;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteException;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.ArrayAdapter;
  import android.widget.ImageView;
  import android.widget.ListView;
  import android.widget.TextView;
  
  public class FindPlaces extends ListActivity{
  
      private SQLiteDatabase DbLoc;
      ListView lv;
      int val;
      private ArrayList&lt;Fields&gt; results = new ArrayList&lt;Fields&gt;();
      @Override
      public void onCreate(Bundle savedInstance) {
          super.onCreate(savedInstance);
          setContentView(R.layout.places);
          getallLocs();
          setListAdapter(new StudentListAdapter(this,  val, results));
      }
  
      class StudentListAdapter extends ArrayAdapter&lt;Fields&gt;{
          private ArrayList&lt;Fields&gt; locationDetails;
          private Context mContext;
  
          public StudentListAdapter(Context context,int textViewResourceId, ArrayList&lt;Fields&gt; results) {
              super(context, textViewResourceId, results);
              // TODO Auto-generated constructor stub
              System.out.println("Constructor StudentList Adapter...");
              this.locationDetails = results;
              mContext = context;
          }
          @Override
          public int getCount() {
              // TODO Auto-generated method stub
              return results.size();
          }
          @Override
          public Fields getItem(int position) {
              // TODO Auto-generated method stub
              return locationDetails.get(position);
          }
          @Override
          public long getItemId(int position) {
              // TODO Auto-generated method stub
              return super.getItemId(position);
          }
          @Override
          public View getView(int position, View convertView, ViewGroup parent) {
              // TODO Auto-generated method stub
              View v = convertView;
              if(v == null){
                  LayoutInflater vl = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                  v = vl.inflate(R.layout.placeslist, null);
              }
              Fields o = results.get(position);
  
              if (o != null) {
                  TextView iv = (TextView)v.findViewById(R.id.toptext);
                  TextView tv_sNo = (TextView)v.findViewById(R.id.toptext1);
                  ImageView tv_Image = (ImageView)v.findViewById(R.id.Locimage);
  
                  iv.setText(o.getLocationName());                            
                  //tv_sNo.setText("Status: "+ o.getOrderStatus());
                  tv_sNo.setText(o.getLocationImage());   
                  tv_Image.setBackgroundResource(o.getLocationImage());
              }
              DbLoc.close();
                              return v;
          }       
      }
      static class ViewHolder
      {
          TextView Locationname;
          ImageView Locationimage;
      }
      private void getallLocs() {
          // TODO Auto-generated method stub
          try {
              DatabaseHelper dbHelper = new DatabaseHelper(
                      this.getApplicationContext());
              DbLoc = dbHelper.getWritableDatabase();
              Cursor c = DbLoc.rawQuery("SELECT " + DatabaseHelper.LocationName+ " , " + DatabaseHelper.LocationImage + " FROM "
                      + DatabaseHelper.LOCATIONTABLE , null);
              System.out.println("SELECT " + DatabaseHelper.LocationLang+" , "+DatabaseHelper.LocationLat+" , "+ DatabaseHelper.LocationName
                      + " ," + DatabaseHelper.LocationImage + " FROM "
                      + DatabaseHelper.LOCATIONTABLE );
              if (c != null) {
                  if (c.moveToFirst()) {
                      do {
                          String LocationName= c.getString(c.getColumnIndex("LocationName"));
                          String Mobile = c.getString(c
                                  .getColumnIndex("LocationImage"));
                          Fields p = new Fields(LocationName, Mobile);
                          results.add(p);
  
                      } while (c.moveToNext());
                  }
              }
          } catch (SQLiteException se) {
              Log.e(getClass().getSimpleName(),
              "Could not create or Open the database");
          } 
                  }
  }
  </code></pre>