Introduction
Android is the most popular mobile platform available in the market. With over 85% market share worldwide, Android Operating System dominates the mobile platform market. Today, I will show you how to use UI Control to pass from one activity to another activity using Kotlin in Android Studio.
Requirements
- Android Studio version 3.5
- Little bit XML and KOTLIN knowledge
- Android Emulator (or) Android mobile
- Download link (Android Studio)
Follow these steps to use UI Control to pass from one activity to another activity using Kotlin In Android Studio. I have included the source code in the attachment.
Step 1
Open Android Studio and start a new Android Studio Project.

Step 2
Now, add the activity and click the "Next" button.

Step 3
You can choose your application name and choose where your project is to be stored and choose Kotlin language for coding the project, Now, select the version of Android and select the target Android devices, and click the "Finish" button.

Step 4
Go to activity_main.xml. This XML file contains the designing code for your Android app.

The XML code is given below.
- <?xml version="1.0" encoding="utf-8"?>
- <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"
- style="@style/LayoutFontStyle"
- tools:context=".MainActivity">
- <TextView android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/employee_database"
- android:layout_gravity="center"
- android:textSize="24sp"
- />
- <TableLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- >
- <TableRow>
- <TextView
- android:text="@string/id_no"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="1" />
- <EditText
- android:id="@+id/id"
- android:layout_width="200dp"
- android:layout_height="wrap_content"
- style="@style/EditTextFontStyle"
- />
- </TableRow>
- <TableRow>
- <TextView
- android:text="@string/name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="1" />
- <EditText
- android:id="@+id/name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- style="@style/EditTextFontStyle"
- />
- </TableRow>
- <TableRow>
- <TextView
- android:text="@string/address"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="1" />
- <EditText
- android:id="@+id/address"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- style="@style/EditTextFontStyle"
- />
- </TableRow>
- <TableRow>
- <TextView
- android:text="@string/email"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="1" />
- <EditText
- android:id="@+id/email"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- style="@style/EditTextFontStyle"
- />
- </TableRow>
- <TableRow>
- <TextView
- android:text="@string/phone"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="1" />
- <EditText
- android:id="@+id/Phone"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- style="@style/EditTextFontStyle"
- />
- </TableRow>
- </TableLayout>
- <TableLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <TableRow>
- <TextView
- android:text="@string/gender"
- android:layout_width="116dp"
- android:layout_height="40dp"
- android:layout_column="1"
- android:layout_gravity="center"
- android:width="200dp"
- />
- <RadioGroup
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/gender"
- android:text="@string/gender">
- <RadioButton
- android:id="@+id/female"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- and
- roid:text="@string/female"
- />
- <RadioButton
- android:id="@+id/male"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/male"
- />
- </RadioGroup>
- </TableRow>
- <TableRow>
- <TextView
- android:text="@string/category"
- android:layout_width="103dp"
- android:layout_height="wrap_content"
- android:layout_column="1"
- />
- <CheckBox
- android:id="@+id/software"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- android:text="@string/software_tester"/>
- </TableRow>
- <TableRow>
- <CheckBox
- android:id="@+id/developer"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- android:text="@string/developer"
- />
- </TableRow>
- <TableRow>
- <CheckBox
- android:id="@+id/Support"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- android:text="@string/support"
- />
- </TableRow>
- <TableRow>
- <CheckBox
- android:id="@+id/marketing"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_column="2"
- android:text="@string/marketing"/>
- </TableRow>
- </TableLayout>
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <Button
- android:id="@+id/button_submit"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="@string/submit"
- />
- </LinearLayout>
- </LinearLayout>





Join the conversation! Your thoughts help the community grow.