Home > other >  Why my app crashing when tap on click listener button
Why my app crashing when tap on click listener button

Time:09-16

here is may Mainactivity java file.

onclick listener when I tap the button app is crashing. show this message. Bug

Please help me with what to do.

CodePudding user response:

For exact root cause, you need to provide your XMLs as well, but meanwhile you can see below link and check if it can help you or not. Look here

CodePudding user response:

Do this...

  1. Check that your setContentView is pointing to the appropriate XML Layout file.

  2. Check that your calling the id of the button correctly from your activity ( R.id.id_of_your_button_in_xml).

Button yourButton = findViewById ( R.id.id_of_your_button_in_xml).

That's it.

  • Related