I am building an android app in which, on the MainActivity the user enters his/her details like name, phone number, etc., in several EditText fields. I should get all those data, pass them to the SecondActivity and display them on textViews. The transition from MainActivity to second activity is done via an onclick event.
Edit text xml
<EditText
android:hint="@string/teacher_name_hint"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="10"
android:id="@+id/teacher_name"
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,., "
android:inputType="textPersonName"
android:maxLength="42"
android:maxLines="2"
android:minLines="1"
android:textColorHint="@color/abc_secondary_text_material_light" />
Onclick Event
public void roll_sheet_Activity(View v)
{
Intent i = new Intent(MainActivity.this,Roll_sheet.class);
startActivity(i);
}