Share activity for results and shareApp data


Share activity for results and shareApp data

Probably, this is one of the most important utilities of Intents in Android. Intents facilitate quick sharing of information amongst the apps. There are two ways, through which data can be shared within the apps. The first, way is using the Android Sharesheet. Android Sharesheet is a tool specifically used for sharing the content outside the application, to another user. A good example of this will be copying the URL, and sharing it with another user. The second way will be to use the Android intent resolver, which also passes or shares the data amongst the apps. The second option is preferred by the developers, as it is more structured, and the activity can be better defined. For example, you have opened a document in the PDF viewer, while allowing the users to select a view of their own choice.

Whenever the intent is created, the developer must specify the action that will be performed by the intent. In Android, ACTION_SEND is used for sending the data from one distinct activity to another, or even to different apps as well as apps on different platforms. In this case, the data type needs to be specified at prior.