title: array adapter is showing field value, not data values from database in android
body: <p>I am trying to show a <code>listview</code> of data from database in <code>fragments</code>. For that reason I've added a table in database. Now I'm trying to create data adapter. Here is my <strong>code</strong>:</p>
  
  <pre><code>list=(ListView)rootView.findViewById(R.id.listView1);
  try{
  DatabaseHandler db = new DatabaseHandler(getActivity());
  List&lt;Label&gt; allLabel = db.getAllLabels();
  for (Label label : allLabel) {   
  ArrayAdapter&lt;Label&gt; dataadapter= new ArrayAdapter&lt;Label&gt;(getActivity(),android.R.layout.simple_list_item_1,allLabel);   
  list.setAdapter(dataadapter);
  
  list.setOnItemClickListener(new OnItemClickListener() {
  
      public void onItemClick(AdapterView&lt;?&gt; parent,View v, int position,long id)
      {
          Toast.makeText(getActivity(), ((TextView)v).getText(), Toast.LENGTH_LONG).show();
  
      }
  });
  }
  }
  catch (Exception e)
  {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>this is my output of containing field value not data value:</p>
  
  <pre><code>   com.qcash.atmlocator.Label@52852d88
     com.qcash.atmlocator.Label@52852dd8
     com.qcash.atmlocator.Label@52852e08
     com.qcash.atmlocator.Label@52852e38
  </code></pre>
  
  <p>this is the getAllLabels() function used in my code:</p>
  
  <pre><code>public List&lt;Label&gt; getAllLabels(){
  
  List&lt;Label&gt; labels = new ArrayList&lt;Label&gt;();
  
  // Select All Query
  String selectQuery = "SELECT  * FROM " + TABLE_LABELS;
  
  SQLiteDatabase db = this.getReadableDatabase();
  Cursor cursor = db.rawQuery(selectQuery, null);
  
  // looping through all rows and adding to list
  if (cursor.moveToFirst()) {
      do {
          Label label = new Label();
          label.setId(cursor.getInt(0));
          label.setName(cursor.getString(1));
          label.setLatitude(cursor.getDouble(2));
          label.setLongitude(cursor.getDouble(3));
          labels.add(label);
      } while (cursor.moveToNext());
  }
  
  // closing connection
  cursor.close();
  db.close();
  
  // returning lables
  return labels;
  }
  </code></pre>
  
  <p>How can I get the database value? please help me out.</p>