While TextViews
are great for displaying text, if you want the user to be able to input text, you should use EditText
instead.
One of the most common examples of EditTexts
in action is a form that requests user data. In this example, each input field is a separate EditText
:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Please complete this form:" android:textSize="20sp" android:id="@+id/TextView" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="textPersonName...