
Thanks for the examples everyone they've helped me understand a lot better the intent system. What is the easiest/best way to do this? I've tried putExtra without any luck. I have a listview and when I make a selection i would like to add that selection to another listview in a different activity. StartActivity(Intent.Hey guys I'm working on an app in android studio. Intent2.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(f) ) tType("application/-archive") //APk file type StartActivity(Intent.createChooser(i, "Share via")) I.putExtra(Intent.EXTRA_STREAM, imgUri) //Uri of image Uri imgUri = Uri.fromFile(new File(path)) //Absolute Path of image I.setType("image/png") //With png image file or set "image/*" type Intent i = new Intent(Intent.ACTION_SEND) Intent2.putExtra(Intent.EXTRA_SUBJECT, "Email Subject") īoolean isPNG = (path.toLowerCase().endsWith(".png")) ? true : false Intent2.putExtra(Intent.EXTRA_EMAIL, new String) StartActivity(Intent.createChooser(intent2, "Share via")) Intent2.putExtra(Intent.EXTRA_TEXT, "Your text here" ) Intent intent2 = new Intent() tAction(Intent.ACTION_SEND) * Share with Intents in Android //Share text: This a great example about share with Intents in Android: I added more to this example of the API's usage on the basis of clemantiano's comment. If that article doesn't answer all of your questions, there is always the Javadoc itself for ShareCompat.IntentBuilder on the Android Developers website. As you'll notice, I borrowed some of this example from that article. If you have any more questions about using ShareCompat, I highly recommend this great article from Ian Lake, an Android Developer Advocate at Google, for a more complete breakdown of the API. * The title of the chooser that the system will show addEmailBcc(arrayOfStringEmailAddresses) * BCC'd on an email as an array of Strings or a single String * Designate the email addresses that will be * Designate the email recipients as an array * For example, to share an image, you'd do the following: * exactly what happens if you don't do that, but

* is set above will have to match the type of data getActivity() or activity field if within Fragment New way of doing this would be using ShareCompat.IntentBuilder like so: // Create and fire off our Intent in one fell swoop
