Skip to content

Instantly share code, notes, and snippets.

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