Right click on “Hello world” Text. View and select Cut.
Click ON the Auto Connect (U) button
Drag a button from the palette to the layout
Change the button’s id and text
Drag a Text. View onto the Layout
Change the Text. View’s id and text
Return to Main. Activity – begin to instantiate a button object
Put mouse over Button (which was red) and click Alt-Enter. Adds the import android. widget. Button
Start adding the button’s set. On. Click. Listener method
Add required on. Click method
Instantiate Text. View object and use its set. Text method
Run • Problem you may find: the Text. View and Button may be on top of one another. • Return to layout and move things around (hoping to alleviate this problem)
Change to Text view of Layout. Notice the Text. View is underlined squiggly red. It is not constrained.