
I'm going to make a exercise of Twitter Client to post update status to Twitter. In which I need a EditText, with hiden input of password.
To achieve it, EditText with android:inputType="textPassword" can be used.The input characters will be displayed as password dots instead of themselves.
Alternatively, android:password="true" can be used. But it is deprecated and not suggested.
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="User Name and Password"
/>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="User Name:"
/>
android:id="@+id/username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Password:"
/>
android:id="@+id/password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textPassword"
/>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="What are you doing?"
/>
android:id="@+id/whatareyoudoing"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
android:id="@+id/mySubmit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Submit"
/>