First steps

From MyWiki
Revision as of 15:51, 4 October 2017 by George2 (Talk | contribs)

Jump to: navigation, search

Simple first program
1. choose empty activity
2. we will edit activity_main.xml and MainActivity.java
3. use api level 16
4. Get rid of "hello world" 5. Drag button
6 width = match parent, change background colour
7 changethe id of the button and also the text

8 onclick property, speccify the name of method
9. public void toDo(View v){

                          }

in oncreate
Button buttonblue;
buttonBlue = (Button) findViewById(R.id.button_blueinvisible);
define button in main activity
if ( v.equlas(buttonblue)) then do the stuff
Toast.makeText(getApplicationcontext(), "asdfadsfa", Toast.LENGTH_SHORT.show())