Android tutorial

Sending simple data to other apps Like Share Via

Sending simple data to other apps Like Share Via

In this Article, I am sharing how to share via simple sending data to other apps. When you use an intent, you must specify the action Intent to “trigger.” Android defines several actions, including ACTION_SEND which, as you can probably guess, indicates that the intent is sending data from one activity to another, even across process boundaries. and share App URL and open App to play store. And share other content.

 

Note: The best way to add a share action item to an ActionBar is to use ShareActionProvider,
 which became available in API level 14.
 ShareActionProvider is discussed in the lesson about Adding an Easy Share Action.

The most straight forward and common use of the ACTION_SEND action is sending text content from one activity to another. For example, the built-in Browser app can share the URL of the currently displayed page as text with any application. This is useful for sharing an article or website with friends via email or social networking. Here is the code to implement this type of sharing:

 

Intent i =new Intent (Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_SUBJECT,R.string.app_name);
String sAux = "\nLet me recommend you Freshre Job Tips  application for Fresher Student \n\n";
sAux = sAux + " https://play.google.com/store/apps/details?id=com.exmple.fresherjobtips&hl=en\n\n";
i.putExtra(Intent.EXTRA_TEXT, sAux);
startActivity(Intent.createChooser(i, "choose one"));

 

 

1 Comment

  1. I’m not sure where you are getting your info, but great topic. I needs to spend some time learning more or understanding more. Thanks for magnificent info I was looking for this information for my mission.|

Comments are closed.