What’s the best way to put a RelativeLayout inside a ToggleButton? If it matters, the RelativeLayout has a bunch of TextViews contained within.
This question is similar to relativelayout and togglebutton , but with a subtle difference. In the referenced question, the user has put a TextView with a ToggleButton inside a RelativeLayout. In my case I want to put the RelativeLayout inside the ToggleButton so that I don’t have to add an onClickListener to the RelativeLayout.
Is this possible only by extending CompoundButton?
Edit: What’s the best way to create a widget/view with ToggleButton-like functionality where the on/off text can be replaced by any other widget/view/viewgroup?
You cannot put a RelativeLayout inside a ToggleButton.
ToggleButton is a
Viewand RelativeLayout is aViewGroup.