Skip to content

Instantly share code, notes, and snippets.

@CodyEngel
Created June 27, 2017 01:12
Show Gist options
  • Save CodyEngel/f7c6f526392600c5525d11b0e0ec8355 to your computer and use it in GitHub Desktop.
Save CodyEngel/f7c6f526392600c5525d11b0e0ec8355 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 View.OnClickListener() {
@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