質問

I created an app that gets the news feed from Facebook and displays it. I want to enable users to comment and like from within my app, but I couldn't find any API for that. I did find a custom URL scheme for Facebook: fb://post/{postId} which I'm trying to use. For each post, I get the post Id and create a link in a textview on Android pointing to that URL. I printed out the URL and this is an example: fb://post/47526370263_10152072729085264

likes is a TextView in my Facebook adapter with the text being the number of likes a post got. I want this view to contain a link to Facebook's app which will open that specific post.

String linkToPost = "fb://post/" + status.getId();

likes.setText(Html.fromHtml("<a href=\"" + linkToPost + "\">" + status.getLikeCount() + " like</a>"));

When I click on the link in my app nothing gets opened. How do I enable people to view/post comments/likes from within my Facebook News Feed app?

役に立ちましたか?

解決

I saw a related answer after I posted this. The solution is to do:

likes.setMovementMethod(LinkMovementMethod.getInstance());
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top