Code example for ResourceCursorAdapter

0
    private static int LAYOUT = R.layout.list_item_sleep_history;
 
    private ViewGroup parent;
 
    public SleepHistoryCursorAdapter(final Context context, final Cursor cursor) {
        super(context, LAYOUT, cursor, true);
    } 
 
    @Override 
    public void bindView(final View view, final Context context,
            final Cursor cursor) {
 
        final SleepSession session = new SleepSession(cursor);
        ((TextView) view.findViewById(R.id.date)).setText(session
                .getDayText(context));
        ((TextView) view.findViewById(R.id.duration)).setText(context
                .getString(R.string.recording_time, session
                        .getTotalRecordAbbrevTime(context.getResources())));
        ((TextView) view.findViewById(R.id.efficiency)).setText(session
                .getEfficiency());