Android examples for android.util:AttributeSet
get Attribute Int Value
//package com.java2s; import android.util.AttributeSet; public class Main { public static int getAttributeIntValue(AttributeSet attrs, String namespace, String attribute, int defValue) { int ret = defValue; if (attrs != null) { ret = attrs/*from ww w .j ava2s. c o m*/ .getAttributeIntValue(namespace, attribute, defValue); if (ret == defValue) { int count = attrs.getAttributeCount(); String temp = null; for (int i = 0; i < count; i++) { temp = attrs.getAttributeName(i); if (temp.equals(attribute)) { ret = attrs.getAttributeIntValue(i, defValue); break; } } } } return ret; } }