I have a main activity with TextViews and class that want’s modify the main activity’s TextViews.
I keep generating NullPointerException errors in my findViewbyID method in my class. I’m assuming because I’m not passing the View to the class method. How do I got about doing this?
you will need to to pass Activity instance to your non Activity class using constructor to access all UI elements from non Activity Class as :
now you can access UI elements from Activity in NonActivity class as: