Skip to content

Instantly share code, notes, and snippets.

@ravikumar-n
Last active January 30, 2017 21:27
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 ravikumar-n/558cef1c0d24bc28ed300d75e406b261 to your computer and use it in GitHub Desktop.
Save ravikumar-n/558cef1c0d24bc28ed300d75e406b261 to your computer and use it in GitHub Desktop.
Step 1:
File -> New -> Activity -> EmptyActivity
Step 2:
Set activity Name as "HelloWorldActivity" and click Finish
(Don't alter any option)
Step 3:
Goto newly generated "HelloWorldActivity" and define a public onClick
method like below:
public void sayHello(View v) {
}
Step 4:
Goto activity_hello_world.xml and switch to design view.
Step 5:
Drag & Drop the Button and click on `onClick` property in the GUI,
the generated selection will be `sayHello (HelloWorldActivity)`
instead of `sayHello`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment