Last active
January 30, 2017 21:27
-
-
Save ravikumar-n/558cef1c0d24bc28ed300d75e406b261 to your computer and use it in GitHub Desktop.
http://stackoverflow.com/questions/41922616/android-button-illegalstateexception-with-onclickmainactivity ;; https://code.google.com/p/android/issues/detail?id=225168
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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