Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Cursor getDayData(String calendarDate) {
- SQLiteDatabase db = this.getWritableDatabase();
- Cursor cursor = db.query(TABLE_NAME, new String[] {
- COL_1,
- COL_2, COL_3, COL_4, COL_5}, COL_3 + " LIKE '%"+ calendarDate + "%'",
- null, null, null, null);
- if(cursor != null) {
- cursor.moveToFirst();
- }
- return cursor;
- }
- dbHelper = new DatabaseHelper(this);
- dbHelper.getWritableDatabase();
- dbHelper.getDayData(dateDBstring);
- String[] from = new String[] {DatabaseHelper.COL_2, DatabaseHelper.COL_3, DatabaseHelper.COL_4};
- int[] to = new int[] {R.id.nameLW, R.id.datetimeLW, R.id.descriptionLW};
- adapter = new SimpleCursorAdapter(this, R.layout.list_row, cursor, from, to, 0);
- listDoDay = (ListView) findViewById(R.id.listDoDay);
- listDoDay.setAdapter(adapter);
- listDoDay.setEmptyView(findViewById(R.id.emptylistDay));
- dbHelper.close();
Add Comment
Please, Sign In to add comment