Android Button in Custom Preference gets enabled automatically
<p>I have a custom preference in my application which consists of a 
textview and a button and it is put in a preference screen. I load the 
layout in the onCreateView of the preference </p>

<pre><code>LayoutInflater inflater =  (LayoutInflater)getContext(). 
getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
    View view = inflater.inflate(R.layout.custom_preference, parent, 
false); 
</code></pre>

<p>In my xml, I have put android:enabled="false" for the button because I 
want to disable it and enable it conditionally later. When my 
preferencescreen comes up, this button is disabled, but gets enabled 
automatically in a second(I still haven't added any code to enable 
this yet). 
Also I find that the onCreateView of my custom preference keeps 
getting called again and again. 
Can someone please help me as to what is happening here?</p>
