Code example for Date

Methods: format

0
	public void bindView(View view, Context context, Cursor cursor) {
		DocumentViewHolder holder = (DocumentViewHolder) view.getTag();
		final String title = cursor.getString(mIndexTitle);
		long created = cursor.getLong(mIndexCreated);
		final String text = cursor.getString(mIndexOCRText);
		CharSequence formattedDate = DateFormat.format("MMM dd, yyyy h:mmaa", new Date(created));
		final int id = cursor.getInt(mIndexId);
		mBinder.bind(view, holder, title, formattedDate, text, cursor.getPosition(),id);
	}; 
 
	@Override 
	public long getItemId(int position) {
		if (getCursor().moveToPosition(position)) {
			int index = getCursor().getColumnIndex(Columns.ID);
			return getCursor().getLong(index);
		} 
		return -1; 
	} 
 
	@Override 
	public View newView(Context context, Cursor cursor, ViewGroup parent) {