title: Listview not getting populated with correct data
body: <p>I am currently trying to populate a listview with a list, my code looks like this</p>
  
  <pre><code>    ListView lv = (ListView) findViewById(R.id.listView1);
      SQLdb sql = new SQLdb(this);
      List&lt;AppUsage&gt; lv_arr = sql.getAllAppUsage();
  
      ArrayAdapter&lt;AppUsage&gt; adapter = new ArrayAdapter&lt;AppUsage&gt;(this,
              android.R.layout.simple_list_item_1, lv_arr);
  
      lv.setAdapter(adapter);
  </code></pre>
  
  <p><strong>AppUsage.java</strong></p>
  
  <pre><code>public class AppUsage {
  
     //private variables
     String _package;
     String _timeopened;
     String _timeclosed;
     String _duration;
     String _name;
  
     // Empty constructor
     public AppUsage(){
  
     }
     // constructor
     public AppUsage(String _package, String _timeopened, String _timeclosed, String _duration, String _name){
         this._package = _package;
         this._timeopened = _timeopened;
         this._timeclosed = _timeclosed;
         this._duration = _duration;
         this._name = _name;
     }
  
    // package
    public void setPackage(String appPackage){
        this._package = appPackage;
    }
  
   // package
   public void setTimeOpened(String timeOpened){
       this._timeopened = timeOpened;
   }
  
  // package
  public void setTimeClosed(String timeClosed){
      this._timeclosed = timeClosed;
  }
  
  // package
  public void setDuration(String duration){
     this._duration = duration;
  }
  
     // setting name
     public void setName(String name){
         this._name = name;
     }
  
  
  
  }
  </code></pre>
  
  <p><strong>SQLdb.java</strong></p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  import android.content.ContentValues;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteOpenHelper;
  
  public class SQLdb extends SQLiteOpenHelper {
  
      public static final String DB_KEY = "key";
      public static final String DB_PACKAGE = "packageName";
      public static final String DB_TIMEOPEN = "timeOpened";
      public static final String DB_TIMECLOSED = "timeClosed";
      public static final String DB_DURATION = "duration";
      public static final String DB_NAME = "appName";
  
  
      private static final int DATABASE_VERSION = 2;
      private static final String DATABASE_NAME = "AppMonitorDB";
      private static final String DICTIONARY_TABLE_NAME = "AppData";
      private static final String DICTIONARY_TABLE_CREATE =
                  "CREATE TABLE " + DICTIONARY_TABLE_NAME + " (" +
                  DB_KEY + " INT PRIMARY KEY, " +
                  DB_TIMEOPEN + " TEXT, " +
                  DB_TIMECLOSED + " TEXT, " +
                  DB_DURATION + " TEXT, " +
                  DB_NAME + " TEXT, " +
                  DB_PACKAGE + " TEXT);";
  
      SQLdb(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          db.execSQL(DICTIONARY_TABLE_CREATE);
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          // Drop older table if existed
          db.execSQL("DROP TABLE IF EXISTS " + DICTIONARY_TABLE_NAME);
  
          // Create tables again
          onCreate(db);
      }
  
         public void addAppUsage(String packageName, String timeOpened, String timeClosed, float duration, String appName) {
              SQLiteDatabase db = this.getWritableDatabase();
  
              ContentValues values = new ContentValues();
              values.put(DB_PACKAGE, packageName);
              values.put(DB_TIMEOPEN, timeOpened);
              values.put(DB_TIMECLOSED, timeClosed);
              values.put(DB_DURATION, duration);
              values.put(DB_NAME, appName);
  
              // Inserting Row
              db.insert(DICTIONARY_TABLE_NAME, null, values);
              db.close(); // Closing database connection
          }
         public AppUsage getAppUsage(int id) {
              SQLiteDatabase db = this.getReadableDatabase();
  
              Cursor cursor = db.query(DICTIONARY_TABLE_NAME, new String[] { DB_PACKAGE,
                      DB_TIMEOPEN, DB_TIMECLOSED, DB_DURATION, DB_NAME }, DB_PACKAGE + "=?",
                      new String[] { String.valueOf(id) }, null, null, null, null);
              if (cursor != null)
                  cursor.moveToFirst();
  
              AppUsage usage = new AppUsage(cursor.getString(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4));
              // return contact
              return usage;
          }
         public List&lt;AppUsage&gt; getAllAppUsage() {
              List&lt;AppUsage&gt; contactList = new ArrayList&lt;AppUsage&gt;();
              // Select All Query
              String selectQuery = "SELECT " + DB_NAME + ", " + DB_PACKAGE + ", Sum(" + DB_DURATION + ") " + DB_DURATION + " FROM "+ DICTIONARY_TABLE_NAME +" GROUP BY " + DB_NAME + ", " + DB_PACKAGE;
  
              SQLiteDatabase db = this.getWritableDatabase();
              Cursor cursor = db.rawQuery(selectQuery, null);
  
              // looping through all rows and adding to list
              if (cursor.moveToFirst()) {
                  do {
                      AppUsage contact = new AppUsage();
                      contact.setName(cursor.getString(0));
                      contact.setPackage(cursor.getString(1));
                      contact.setDuration(cursor.getString(2));
                      // Adding contact to list
                      contactList.add(contact);
                  } while (cursor.moveToNext());
              }
  
              // return contact list
              return contactList;
          }
  }
  </code></pre>
  
  <p>My problem is that it does get populated but the data doesn;t look correct, instead it's using the apps package name and weird number, like the below for example</p>
  
  <pre><code>com.package.name.appname@41509668
  </code></pre>
  
  <p>Am I doing something wrong? </p>