Android tutorial

Sending simple data to other apps Like Share Via

abc
692views

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.

Screenshot 2019 01 09 14 52 18 share

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"));

 

 

Welcome to my blog! I’m Ritu Malik, and here at Codeplayon.com, we are dedicated to delivering timely and well-researched content. Our passion for knowledge shines through in the diverse range of topics we cover. Over the years, we have explored various niches such as business, finance, technology, marketing, lifestyle, website reviews and many others.