Checkboxpreference With Additional Button?
I'd like to show an additional button in a CheckBoxPreference. I've managed this by subclassing CheckBoxPreference and a custom layout (using this code as a basis). However, I stru
Solution 1:
Create an instance variable for the click listener within your subclass of CheckBoxPreference
, which holds the listener you wish to set. Create a setter for this variable, calling notifyChanged()
after setting the value. This will cause the onBindView
method to be called on listener changes.
Now you can use this variable from within onBindView
, set your listener to the button's view there (view.findViewById(R.id.yourbuttonid)
).
Post a Comment for "Checkboxpreference With Additional Button?"