Code example for AttributeSet

Methods: getAttributeIntValue

0
        mAdapters = new ArrayList<WrapAdapter>();
    } 
 
    public MyView(Context context, AttributeSet attrs) {
        super(context, attrs);
        int columns = attrs.getAttributeIntValue("http://schemas.android.com/apk/res-auto","numColumns",1);
        mColumns = new ArrayList<ListView>(columns);
        mAdapters = new ArrayList<WrapAdapter>(columns);
        mColumnCount = columns;
    } 
 
    public MyView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        int columns = attrs.getAttributeIntValue("http://schemas.android.com/apk/res-auto","numColumns",1);
        mColumns = new ArrayList<ListView>(columns);
        mAdapters = new ArrayList<WrapAdapter>(columns);
        mColumnCount = columns;
    } 
 
    private void initLayout() { 
        mRoot = new LinearLayout(getContext());