然而,我只是得到了一个NullPointerException: Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference at .onCreate(MainActivity.java:32) -Line 32 is the Line with "button_get_started.setOnClic
我现在正在学习为android编写代码,我不知道为什么会这样:add.setOnClickListener(新的View.OnClickListener()抛出一个NullPointerExceptionR.id.bSub);
add.setOnClickListener(new View.OnClickListenerdisplay.setText("Your total is " + counter