Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cursor = db.query(DbHelper.TABLE, null, null, null, null, null, DbHelper.C_TIMESTAMP + " DESC", null);
- startManagingCursor(cursor);
- adapter = new SimpleCursorAdapter(this, R.layout.stream, cursor, FROM, TO);
- adapter.setViewBinder(VIEW_BINDER);
- listStream.setAdapter(adapter);
- ...
- static final ViewBinder VIEW_BINDER = new ViewBinder() {
- public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
- if (view.getId() == R.id.textTimestamp) {
- String postDate = cursor.getString(columnIndex);
- ((TextView) view).setText(tHandler.getRelativeLocalTime(view.getContext(),postDate));
- return true;
- ...
- <ListView
- android:layout_height="fill_parent"
- android:layout_width="fill_parent"
- android:id="@+id/listStream"
- android:background="@color/lightGreen"
- android:layout_below="@+id/streamHeader">
- </ListView>
Add Comment
Please, Sign In to add comment