Use of Intent to share text and links

The text from Edittext fields and from Textview fields can be shared from the App using Intent. Here are the Logic blocks to be used for the purpose.

1. To share text to WhatsApp
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData join whatsapp://send?text=and (Edittext/Textview)getText
  • StartActivity (name)

2. To share text to Twitter
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData join http://twitter.com/share?text=and (Edittext/Textview)getText
  • StartActivity (name)

3. To share text on Facebook
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData join https://www.facebook.com/sharer.php?u=[URL]&t=and (Edittext/Textview)getText
  • StartActivity (name)

4. To share on Google plus
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData join https://plus.google.com/share?url=[URL]&text=and (Edittext/Textview)getText
  • StartActivity (name)

5. To share a link on LinkedIn
  • Intent (name) setAction ACTION_VIEW
  • Intent (name) setData https://www.linkedin.com/shareArticle?mini=true&url=[URL]&title=[Title]&summary=[text]&source=[text]
  • StartActivity (name)



Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation