Code example for CursorAdapter

Methods: getItem

0
 
    /** {@inheritDoc} */ 
    @Override 
    protected void onListItemClick(ListView l, View v, int position, long id) {
        // Launch viewer for specific vendor 
        final Cursor cursor = (Cursor)mAdapter.getItem(position);
        final String vendorId = cursor.getString(VendorsQuery.VENDOR_ID);
        final Uri vendorUri = Vendors.buildVendorUri(vendorId);
        startActivity(new Intent(Intent.ACTION_VIEW, vendorUri));
    } 
 
    /** 
     * {@link CursorAdapter} that renders a {@link VendorsQuery}. 
     */ 
    private class VendorsAdapter extends CursorAdapter {
        public VendorsAdapter(Context context) {
            super(context, null);
        } 
 
        /** {@inheritDoc} */ 
        @Override