public void noteUpdateAdapter() {
    DatabaseHelper db = new DatabaseHelper(this);

    Cursor c = db.query("NoteTable", projectId);
    Log.d("PID 2", String.valueOf(projectId));
    if (c != null && c.getCount() >= 0) {
      @SuppressWarnings("deprecation")
      ListAdapter la =
          new SimpleCursorAdapter(
              this,
              android.R.layout.simple_list_item_1,
              c,
              new String[] {"note_content"},
              new int[] {android.R.id.text1});
      tabHostListView.setAdapter(la);
    }
    db.close();
  }
Example #2
0
  public void UpdateAdapter() {
    DatabaseHelper db = new DatabaseHelper(this);

    Cursor c =
        db.getReadableDatabase()
            .query("ProjectTable", null, null, null, null, null, "_id desc", null);
    if (c != null && c.getCount() >= 0) {
      @SuppressWarnings("deprecation")
      ListAdapter la =
          new SimpleCursorAdapter(
              this,
              android.R.layout.simple_list_item_2,
              c,
              new String[] {"project_name", "project_time"},
              new int[] {android.R.id.text1, android.R.id.text2});
      listView.setAdapter(la);
    }
    db.close();
  }