public abstract int getAttributeCount ()
Added in API level 1
Returns the number of attributes of the current start tag, or -1 if the current event type is not START_TAG
Basically you might use this just within START_TAG
. As you're using it within END_TAG
, it's logical that you're receiving a -1 value.