Android - Preference onCreateView attrs.getAttributeCount()
<p>How do I get the "max" attribute during onCreateView()?
If I can get attrs.getAttributeCount() to work that would solve my problem.</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;PreferenceScreen
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:title="@string/livewallpaper_settings"
        android:key="livewallpaper_settings"
    &gt;
        &lt;com.example.myapp.SeekBarPreference1
            android:persistent="true"
            android:key="keyItems"
            android:title="Items"
            android:defaultValue="50"
            android:max="200" /&gt;
        &lt;com.example.myapp.SeekBarPreference1
            android:persistent="true"
            android:key="keyItemsTwo"
            android:title="Items Two"
            android:defaultValue="5"
            android:max="10" /&gt;
    &lt;/PreferenceScreen&gt;  
</code></pre>

<p>Here is the simplified class. XmlPullParser does not return anything to parse.</p>

<pre><code>    public final class SeekBarPreference1 extends Preference implements OnSeekBarChangeListener {

        private static int _maxValue = 0;
        private int _currentValue = 0;
        private TextView _value;
        private SharedPreferences _preferences;

        public SeekBarPreference1(Context context, AttributeSet attrs) {
            super(context, attrs);
            _preferences = PreferenceManager.getDefaultSharedPreferences(context);

            //
            // These values are correct
            //
            Log.d("PREFS", " ");
            Log.d("PREFS", "SeekBarPreference1");
            Log.d("PREFS", "Key: " + getKey());
            Log.d("PREFS", "AttrCount: " + attrs.getAttributeCount());
            Log.d("PREFS", "####");
        }

        @Override
        protected View onCreateView(ViewGroup parent) {

            XmlPullParser attrs = parent.getResources().getXml(R.xml.livewallpaper_settings);

            Log.d("PREFS", " ");
            Log.d("PREFS", "onCreateView");
            Log.d("PREFS", "Key: " + getKey()); // Correct key is output
            Log.d("PREFS", "AttrCount: " + attrs.getAttributeCount()); // -1
            Log.d("PREFS", "####");  

        }
}
</code></pre>

<p>Log output</p>

<pre><code>SeekBarPreference1
Key: keyItems
AttrCount: 7
####

SeekBarPreference1
Key: keyItemsTwo
AttrCount: 7
####

onCreateView
Key: keyItems
AttrCount: -1
####

onCreateView
Key: keyItemsTwo
AttrCount: -1
####
</code></pre>

<p>It seems to me that if I can get the correct key, title, summery, etc. (from onCreateView) there should be a simple way to get other attributes.?</p>

<p>If I try and store the attributes from SeekBarPreference1(), they are lost as soon as onCreateView() is called.</p>

<p>Summery: get the attributes from the current "this" onCreateView();</p>
