Changes

Jump to: navigation, search

Android Activity State Changes - An Example Application

No change in size, 15:31, 3 July 2014
Designing the User Interface
With the project created, it is now time to design the user interface for the example application. By default, however, the Graphical Layout tool is displaying a design canvas for the Nexus One device. Using the toolbar menu within the Graphical Layout tool panel, click on Nexus One to display the drop down menu and change the device to a different model if required. Using the menu to the right of the device menu, change the orientation from Landscape to Portrait if necessary.
Instead of the TextView currently present in the user interface design, the activity actually requires an EditText view. Select the TextView object in the Graphical Layout canvas and press the Delete key on the keyboard to remove it from the design. Select the Text Widgets Fields category from the palette and drag and drop an “abc” Plain Text EditText widget into the center of the design layout.
When working with EditText views in an Android user interface it is necessary to declare the input type for the view. This simply defines the type of text or data that will be entered by the user. For example, if the input type is set to Phone, the user will be restricted to entering numerical digits into the view. Alternatively, if the input type is set to TextCapCharacters, the input will default to upper case characters. Input type settings may also be combined.

Navigation menu