Thursday, August 25, 2011

[android-developers] Button in Custom Preference gets enabled automatically

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

LayoutInflater inflater = (LayoutInflater)getContext().

getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.custom_preference, parent,
false);

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?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment