Introduction
In this article, I will explain how to send some comments or messages to another activity in Android. In this article, I want to send my message to another activity that is a login activity of another company. To understand how to do that see the following instructions.
Step 1
Create a new Android project as "File" ->"New" -> "Android Application Project" as shown in the following image:

Step 2
Now open the XML file as "res/layout/activity_main.xml" and update it with the following code:
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Name : "/>
- <EditText android:id="@+id/name"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dip"/>
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Email : "
- />
- <EditText android:id="@+id/email"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dip"/>
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Mobile :" />
- <EditText
- android:id="@+id/mobile"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:ems="10"
- android:maxLength="10"
- android:inputType="phone" >
- <requestFocus />
- </EditText>
- <TextView
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="Comment :" />
- <EditText
- android:id="@+id/comment"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:ems="10" />
- <Button
- android:id="@+id/btnNextScreen"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="15dip"
- android:text="Connect to Next" />
- </LinearLayout>
Step 3
Open the Java file as "MainActivity.java" and update it with the following code:



Join the conversation! Your thoughts help the community grow.