【发布时间】:2015-06-15 11:16:50
【问题描述】:
ShareDialog shareDialog = new ShareDialog(this);
shareDialog.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() {
@Override
public void onSuccess(Sharer.Result result) {
Toast.makeText(SharePage.this, "ok", Toast.LENGTH_SHORT).show();
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException error) {
Toast.makeText(SharePage.this, error.getMessage(), Toast.LENGTH_LONG).show();
}
});
SharePhoto photo = new SharePhoto.Builder().setBitmap(bm).setCaption(description).build();
SharePhotoContent content = new SharePhotoContent.Builder().addPhoto(photo).build();
shareDialog.show(content);
下面的代码运行。
如果我在手机中有 facebook 应用程序,它会成功分享照片。
但是如果我删除 facebook 应用程序,callbackManager 会返回错误“Unable to show the provided content via the web or the installed version of the Facebook app. Some dialogs are only supported starting API 14.”
【问题讨论】:
-
我该如何解决这个问题?任何人都可以帮助我吗?谢谢!
-
嗨弗兰基,你解决了这个问题吗?我在某些设备上遇到了同样的问题,但仍未解决。你能帮忙吗?