Created
November 1, 2014 05:25
-
-
Save msomu/3af4a9ded6ad6be17c01 to your computer and use it in GitHub Desktop.
Button click using ClickListener
This file contains hidden or 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
| <Button | |
| android:id="@+id/button1" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:text="@string/abc_action_bar_home_description" | |
| /> |
This file contains hidden or 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
| public class MyActivity extends ActionBarActivity implements View.OnClickListener{ | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| //Log.d("SOMU","On Create called"); | |
| setContentView(R.layout.activity_my); | |
| one = (Button) findViewById(R.id.button1); | |
| one.setOnClickListener(this); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment