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

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

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

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key