Q4. Create
an application with first activity with an editText and send button. On click
of send button, make use of implicit intent that uses a SEND ACTION and let
user select app from app chooser and navigate to that application.
Q4. Create an application with first activity with an editText and send button. On click of send button, make use of implicit intent that uses a SEND ACTION and let user select app from app chooser and navigate to that application.
Android Program :
Activity_main.xml
<?xml
version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.kishanhaldar.implicit_intent.MainActivity">
<Button
android:text="Send Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="117dp"
android:layout_marginStart="117dp"
android:layout_marginTop="47dp"
android:id="@+id/button"
android:onClick="msgsend"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="@+id/editText"
android:layout_below="@+id/button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="54dp"
android:layout_marginEnd="54dp"
android:layout_marginTop="24dp" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
MainActivity.java
MainActivity.java
Comments
Post a Comment