i need some help. I'm making an app on android studio and I have a Button initialized in a Fragment. I need to call this button in another Activity and set a click listener on it.
The problem is that when I do this I get the .NullPointerExceptionError and it says that the value of the object is null.
Now i tried to initialize the button in both my fragment and Activity but I keep getting that error and the app crashes.
I need some help to call this button from the Fragment. Maybe my question is similar to some other but it's hours that I'm searching a solution to this problem and I found nothing.
Thanks in advance for all your help