Code example for ListView

Methods: getAdapter

0
        getListView().setAdapter(new PolicyListAdapter());
    } 
 
    @Override 
    public void onListItemClick(ListView l, View v, int position, long id) {
        DeviceAdminInfo dpi = (DeviceAdminInfo)l.getAdapter().getItem(position);
        Intent intent = new Intent();
        intent.setClass(getActivity(), DeviceAdminAdd.class);
        intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, dpi.getComponent());
        startActivity(intent);
    } 
 
    static class ViewHolder { 
        ImageView icon;
        TextView name;
        CheckBox checkbox;
        TextView description;
    } 
     
    class PolicyListAdapter extends BaseAdapter {