Changes

Jump to: navigation, search

An Overview and Example of Android Event Handling

No change in size, 19:05, 26 June 2013
no edit summary
== Designing the User Interface ==
The user interface layout for the EventExampleActivity class in this example is to consist of a RelativeLayout view, a Button and a TextView as illustrated in Figure 1617-1.
[[Image:android_event_handling_example_ui2.png|The user interface for an Android TOuch Touch application]]
Figure 1617-1
Locate and select the activity_event_example.xml file created by Eclipse (located in the Package Explorer under EventExample -> res -> layout -> activity_event_example.xml) and double click on it to load it into the editing panel. Switch from the Graphical Layout tool to the XML file using the tab at the bottom of the editing panel and delete the current content of the file. With a blank canvas, either use the Graphical Layout tool to design the user interface from Figure 16 17-1 (making sure to change the IDs of the Button and TextView objects to myButton and myTextView respectively), or directly enter the following XML into the editor:
<pre>
[[Image:eclipse_create_new_string_Resource.png|Creating an Android string resource in Eclipse]]
Figure 1617-2

Navigation menu