Code example for CursorAdapter

0
    } 
     
    public class CustomCursorAdapter extends CursorAdapter {
 
        public CustomCursorAdapter(Context context, Cursor c) {
            super(context, c, true);
        } 
 
        @Override 
        public void bindView(View view, Context context, Cursor cursor) {
             
            String entry = cursor.getString(cursor.getColumnIndex(StatsSearchEngineTermsTable.Columns.SEARCH));
            int total = cursor.getInt(cursor.getColumnIndex(StatsSearchEngineTermsTable.Columns.VIEWS));
 
            // entries 
            TextView entryTextView = (TextView) view.findViewById(R.id.stats_list_cell_entry);
            entryTextView.setText(entry);
 
            DecimalFormat formatter = (DecimalFormat) DecimalFormat.getInstance(Locale.getDefault());
             
            // totals