Open the "activity_linear_layout.xml" in view, drag Design an widget (under the section of the AutoCompleteTextView Expert Palette) and placed it below the (Figure 103). Spinner Figure 103: activity_linear_layout.xml In the an and attach it to the "LinearLayout.java", create ArrayAdapter spinner as shown in Figure 104. Figure 104: Binding AutoCompleteTextView to Data Source Launch it on an AVD, type in a letter and the in action (Figure 105) AutoCompleteTextView Figure 105: AutoCompleteTextView at work! Progress Bar It is a common practice to show users a on their screen when they are progress bar uploading or downloading lengthy stuff from the Internet. In Android, the progress bar is implemented through a class which is actually a UI by itself. ProgressDialog You will create a progress bar on the page and get it to simulate a "RelativeLayout" task in progress upon a button click. Open the "activity_relative_layout.xml" in view, change Text the attribute and add an attribute to the android:text android:onClick <New node as Button> android:text="Show Progress..." android:onClick="showProgress" In the add the method as shown in "RelativeLayout.java", showProgress Figure 106. This method will be called when the "Show Progress..." button is clicked. The code will instantiate a object and set some of ProgressDialog its properties like and setMessage setProgressStyle. This object will run in a separate thread so that it does not ProgressDialog block the main UI thread.
Open the "activity_linear_layout.xml" in Design view, drag an AutoCompleteTextView widget (under the Expert section of the Palette) and placed it below the Spinner (Figure 103). Figure 103: activity_linear_layout.xml In the "LinearLayout.java", create an ArrayAdapter and attach it to the spinner as shown in Figure 104. Figure 104: Binding AutoCompleteTextView to Data Source Launch it on an AVD, type in a letter and the AutoCompleteTextView in action (Figure 105) Figure 105: AutoCompleteTextView at work! Progress Bar It is a common practice to show users a progress bar on their screen when they are uploading or downloading lengthy stuff from the Internet. In Android, the progress bar is implemented through a ProgressDialog class which is actually a UI by itself. You will create a progress bar on the "RelativeLayout" page and get it to simulate a task in progress upon a button click. Open the "activity_relative_layout.xml" in Text view, change the android:text attribute and add an android:onClick attribute to the <New Button> node as android:text="Show Progress..." android:onClick="showProgress" In the "RelativeLayout.java", add the showProgress method as shown in Figure 106. This method will be called when the "Show Progress..." button is clicked. The code will instantiate a ProgressDialog object and set some of its properties like setMessage and setProgressStyle. This ProgressDialog object will run in a separate thread so that it does not block the main UI thread.
Android%20UI%20and%20Controls%20New.docx