我正在尝试构建一个通过Facebook Messenger与Android Studio共享链接的应用程序。
我安装了Facebook SDK并包含了Facebook doc说的代码: https://developers.facebook.com/docs/android/share/#message-dialog
// Check if the Facebook app is installed and we can present the share dialog
FacebookDialog.MessageDialogBuilder builder = new FacebookDialog.MessageDialogBuilder(getActivity())
.setLink("https://developers.facebook.com/docs/android/share/")
.setName("Message Dialog Tutorial")
.setCaption("Build great social apps that engage your friends.")
.setPicture("http://i.imgur.com/g3Qc1HN.png")
.setDescription("Allow your users to message links from your app using the Android SDK.")
.setFragment(this);
Android Studio出现此错误:
@" getActivity()":"无法解决方法"
我尝试将其替换为#34;这个"但随后出现下一个错误:
in(android.support.v4.app.Fragment)中的".setFragment(this);" : "setFragment
无法应用于..."
我没有使用碎片......我应该吗?