I created a Compound Control that is added at runtime from an activity, but will need to be removed when a button is clicked from within the control.
How do I send a message to the parent LinearLayout and tell it to remove the control? (Or tell it to remove itself - if that's even possible) If possible I'd like a method to do this from within the control itself.
Thanks.
Save reference of your control after creating, and use ViewGroup.removeView method when it is necessary.
If you need to do it from control itself, invoke ((ViewGroup)getParent()).removeView(this) from within the control.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With