Attempt to invoke virtual method on a null object reference with set on click listener
问题 I am trying to have a button within a popup send a variable to another class. However, when setting the on click listener I get this issue. I have initialized the button and tried to move the code to a different location. I have removed some of the code after the issue as it is not relevant import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import android.Manifest; import android.annotation.SuppressLint; import