Created
August 17, 2014 19:25
-
-
Save gskielian/824f9037a7ba087bb82e to your computer and use it in GitHub Desktop.
Hello World: Button-TextView Update Android : )
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
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Button doStuffButton = (Button) findViewById(R.id.do_stuff_button); | |
TextView myTextView = (TextView) findViewById(R.id.textView1); | |
//remember lowerCamelCase for buttons | |
doStuffButton.setOnClickListener(new View.OnClickListener() { | |
//here we send the user to the next activity | |
@Override | |
public void onClick(View view) { | |
myTextView.setText("Shabaka!"); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment