Q4
Question 4
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 chooser and navigate to that application.

Code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/editText"
android:layout_marginTop="40dp"
android:onClick="share"
android:text="Send"
android:textColorHighlight="@color/black"/>
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:layout_marginTop="250dp"
android:inputType="textPersonName"
android:text="Some Text to send"
android:textAlignment="center"/>
</RelativeLayout>
Download Q4_Implicit_Intent.apk to Run and Test Locally
Output






Last updated