【发布时间】:2016-10-12 11:28:52
【问题描述】:
我将 Facebook ShareButton 从 4.5.0 升级到 4.16.1,现在 ShareButton 已禁用。我必须支持回到 Android API 级别 9,我只想使用 Facebook SDK 中的 ShareButton。在 4.5 中,它运行良好。
这是清单中的 Facebook 活动,我不使用提供程序:
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
tools:replace="android:theme" />
FB Button onClick 监听器:
facebookShareButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentTitle(title)
.setContentDescription(preview)
.setContentUrl(Uri.parse(url))
.build();
shareDialog.show(content);
}
});
我在我的 Application 类中初始化 Facebook SDK,如下所示:
FacebookSdk.sdkInitialize(this);
为什么升级 SDK 后就不行了?
【问题讨论】:
标签: android facebook-share facebook-sdk-4.x