So I have done some research, and after defining you button as an object by the code
private Button buttonname;
buttonname = (Button) findViewById(R.id.butto
Your Activity
must implement View.OnClickListener
, like this:
public class MainActivity extends
Activity implements View.OnClickListener{
// YOUR CODE
}
And inside MainActivity
override the method onClick()
, like this:
@override
public void onClick (View view){
//here YOUR Action response to Click Button
}