Code example for CursorAdapter

Methods: getCursor

0
        return 2; 
    } 
 
    @Override 
    public int getItemViewType(int position) {
        return ((SectionCursor) getCursor()).isSectionHead(position) ? 0 : 1;
    } 
 
    @Override 
    public View newView(final Context context, final Cursor cursor, final ViewGroup viewGroup) {
        if (((SectionCursor) cursor).isSectionHead()) {
            return View.inflate(context, R.layout.list_header, null);
        } else { 
            return View.inflate(context, R.layout.list_item, null);
        } 
    } 
 
    @Override 
    public void bindView(final View view, final Context context, final Cursor cursor) {
        if (((SectionCursor) cursor).isSectionHead()) {
Stop searching for code, let great code find you!  Add Codota to your java IDE