Skip to content

Instantly share code, notes, and snippets.

@CodyEngel
Created June 27, 2017 01:29
Show Gist options
  • Save CodyEngel/606c383a1d8fb36c5a0e373cce0bd536 to your computer and use it in GitHub Desktop.
Save CodyEngel/606c383a1d8fb36c5a0e373cce0bd536 to your computer and use it in GitHub Desktop.
public class AwesomeButtonActivity extends AppCompatActivity implements View.OnClickListener {
private Button awesomeButton;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
awesomeButton = new Button(this);
awesomeButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
awesomeButtonClicked();
}
private void awesomeButtonClicked() {
awesomeButton.setText("AWESOME!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment