Skip to content

Instantly share code, notes, and snippets.

@choiboi
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save choiboi/529f9e576ac650930fea to your computer and use it in GitHub Desktop.
Save choiboi/529f9e576ac650930fea to your computer and use it in GitHub Desktop.
// Button listener implemented by not implmenting this class with
// OnClickListener. When button is pressed, it will invoke the onClick method
// inside the OnClickListener object created when the listener has been set.
Button implementListenerButton = (Button) findViewById(R.id.button_object_onclicklistener);
implementListenerButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Toast.makeText(ButtonMainActivity.this, "Button listener created while setting the button listener pressed!", Toast.LENGTH_LONG).show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment