Android Share App Data (ACTION_SEND)

Android uses ACTION_SEND event of android.content.Intent class to send data from one activity to another and from current activity to outside the application. Intent class needs to specify the data and its type which is to be share.

Most commonly, ACTION_SEND action sends URL of build-in Browser app. While sharing the data, Intent call createChooser() method which takes Intent object and specify the title of the chooser dialog. Intent.createChooser() method allows to display the chooser.

Example of ACTION_SEND

In this example, we are going to share plain text which is a URL of browser.

activity_main.xml

File: activity_main.xml

Activity class

File: MainActivity.java

Output

android Share App Data 1
android Share App Data 2
Next TopicAndroid Fragments




Contact US

Email:[email protected]

Share App Data
10/30