Here we can see the result of having clickable autoLinks in our TextView a URL

Here we can see the result of having clickable

This preview shows page 20 - 27 out of 99 pages.

Here we can see the result of having clickable autoLinks in our TextView : a URL launches the browser, a phone number launches the dialer, and a street address launches Google Maps.
Image of page 20

Subscribe to view the full document.

Retrieving Data from Users with EditText The Android SDK provides a number of controls for retrieving data from users. One of the most common types of data that applications often need to collect from users is text. Two frequently used controls to handle this type of job are EditText controls and Spinner controls.
Image of page 21
Retrieving Text Input Using EditText Controls The Android SDK provides a convenient control called EditText to handle text input from a user. The EditText class is derived from TextView . Most of its functionality is contained within TextView but is enabled when created as an EditText .
Image of page 22

Subscribe to view the full document.

Retrieving Text Input Using EditText Controls (Cont’d) Here we can see an Activity with various styles of EditText , Spinner , and Button controls.
Image of page 23
Retrieving Text Input Using EditText Controls (Cont’d) <EditText android:id="@+id/EditText01" android:layout_height="wrap_content" android:hint="type here" android:lines="4" android:layout_width="fill_parent" /> This layout code shows a basic EditText element. There are a couple of interesting things to note. First, the hint attribute puts some text in the edit box that goes away when the user starts entering text (run the sample code to see an example of a hint in action). Essentially, this gives a hint to the user as to what should go there. Next is the lines attribute, which defines how many lines tall the input box is. If this is not set, the entry field grows as the user enters text. However, setting a size allows the user to scroll within a fixed sized to edit the text. This also applies to the width of the entry.
Image of page 24

Subscribe to view the full document.