i want to share some text and variable values on facebook. i try some code but it opens facebook for sharing on timeline but didnot include text in that so how to fix it,
ShareLinkContent linkContent=new ShareLinkContent.Builder()
.setQuote("Today my Activity isn Steps taken by me = "+currentSteps
+"n Calories burn by me =" + calories+
"n Distance that i covered = "+ distanceCover).build();
shareDialog.show(linkContent);
i am trying this code in alertDialogBox’s button.
i am using android studio 3.1.4 with API 28.
2
Answers
Sadly, there is no way to share “any” text so easily on Facebook 😕you can share urls with the regular text share intent… like this:
But that will work just with urls. If you want to share any content (text) you’ll have to use the Facebook SDK
https://developers.facebook.com/docs/sharing/android
Good luck! 😄
I have achieved a workround by using the clipboard as an intermediary, the user has full control; my app doesn’t paste the text but the user can. See this https://stackoverflow.com/a/53323770/8424520