How to access Button inside Activity from Fragment. Actually I set myButton is disabled but when some of my radioButtons was clicked i want to set myButton enabled?
There are a few things you could try. The first one is to use getActivity().findViewByIt(id) to get the Button, which I think should work but it's not a good solution from the engineering side of things since your Fragment would make assumptions about the Activity layout that hosts it. The second would be to provide a callback interface as described here. Just call the callback method every time the checkbox changes state. This approach is better since the Fragment can be freely re-used by any activity that implements the callback interface. Last but not least, you should try to put the Button inside the fragment if at all possible.
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