TypedArray attributes = context.getTheme().obtainStyledAttributes(new int[] {android.R.attr.enabled}); boolean isEnabled = attributes.getBoolean(0, true);
TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.CustomView); boolean isAvailable = attributes.getBoolean(R.styleable.CustomView_isAvailable, false);In this case, the package library would be the package containing the custom view (R.styleable.CustomView).