Skip to content

Instantly share code, notes, and snippets.

@tmk815
Created June 9, 2017 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmk815/1af19c7ace91b9e6ce7f5fa994a0ed70 to your computer and use it in GitHub Desktop.
Save tmk815/1af19c7ace91b9e6ce7f5fa994a0ed70 to your computer and use it in GitHub Desktop.
SimpleCursorAdapter_Sample
public boolean setViewValue(View view, Cursor cursor, int columnIndex) {
switch (columnIndex) {
case 0:
TextView date = (TextView) view;
date.setText(cursor.getString(1) + "-" + cursor.getString(2) + "-" + cursor.getString(3));
return true;
case 1:
TextView id = (TextView) view;
int time = 1;
int minute = 30;
id.setText(String.format("%d時間%02d分", time, minute));
return true;
default:
break;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment