Is there any way to access a layout’s view from a non-Activity-derived class? I’m creating an Accordion class and need to access some of the activity’s UI elements. I’m passing in the activity’s context to my accordion class’s constructor, but the findViewById API is only available from the Activity class. I also don’t want to pass in an instance of my activity since that seems to be frowned upon due to potential memory leaks.
Is there any way to access a layout’s view from a non-Activity-derived class? I’m
Share
I passed in an instance of one of the Views into the class’s constructor.