Now it's time to implement the new layout that will be used by the password dialog. You begin by creating a new layout resource file called password_dialog.xml. This layout file dictates the user interface of the dialog. To create this file, you follow these steps:
1. Open the Eclipse layout resource editor and add a new file called /res/lay-out/password_dialog.xml to the project.
2. Add a LinearLayout control. Set its id attribute to root and set its orientation attribute to vertical. Set its layout_width and layout_height attributes to fill_parent. All subsequent controls will be added inside this LinearLayout control.
3. Add a TextView control to display the Password label text. Then add an EditText control and set its id attribute to EditText_Pwd1, its maxLines attribute to 1, and its inputType attribute to textPassword.
4. Add another TextView control to display the Password label text again. Then add another EditText control and set its id attribute to EditText_Pwd2, its maxLines attribute to 1, and its inputType attribute to textPassword.
5. Finally, add a TextView control with the id attribute TextView_PwdProblem to display the password status label text. This TextView control will display whether the two password fields match.
At this point, save the password_dialog.xml layout file.
Was this article helpful?