Guest User

Untitled

a guest
Nov 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. public Cursor getDayData(String calendarDate) {
  2. SQLiteDatabase db = this.getWritableDatabase();
  3. Cursor cursor = db.query(TABLE_NAME, new String[] {
  4. COL_1,
  5. COL_2, COL_3, COL_4, COL_5}, COL_3 + " LIKE '%"+ calendarDate + "%'",
  6. null, null, null, null);
  7. if(cursor != null) {
  8. cursor.moveToFirst();
  9. }
  10. return cursor;
  11. }
  12.  
  13. dbHelper = new DatabaseHelper(this);
  14. dbHelper.getWritableDatabase();
  15. dbHelper.getDayData(dateDBstring);
  16.  
  17. String[] from = new String[] {DatabaseHelper.COL_2, DatabaseHelper.COL_3, DatabaseHelper.COL_4};
  18. int[] to = new int[] {R.id.nameLW, R.id.datetimeLW, R.id.descriptionLW};
  19. adapter = new SimpleCursorAdapter(this, R.layout.list_row, cursor, from, to, 0);
  20.  
  21. listDoDay = (ListView) findViewById(R.id.listDoDay);
  22. listDoDay.setAdapter(adapter);
  23. listDoDay.setEmptyView(findViewById(R.id.emptylistDay));
  24.  
  25. dbHelper.close();
Add Comment
Please, Sign In to add comment