Error Message: "java.lang.NullPointerException: Attempt to Invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on an all object reference"
[Direct translation] Empty pointer exception: Android.widget.Button.setOnClickListener method tried to call for reference to empty object
In the code of the question, you are trying to invoke setOnClickListener.
There are two locations, so
If you print the arguments in and the returned values, you will be able to determine where null was returned.
That is what caused the null object reference.
If you return a proper object reference, no exceptions should occur.
Please do your best to find out.
© 2022 OneMinuteCode. All rights reserved.