[Solved] Compiler does not recognize button
[ad_1] The Button and View classes need to be imported; e.g. import android.widget.Button; import android.view.View; Your class is in the default package, so all classes that it uses (apart from those in the java.lang package) need to be imported. The reference to button_id is probably a mistake. Button mButton = (Button) findViewById(R.id.button); final Button button … Read more