自定义对话框中的ShareDialog Facebook - Android

时间:2017-03-20 03:10:33

标签: android facebook dialog

我希望在ShareDialog中使用Facebook的Custom Dialog,但在初始化时,我无法将上下文值设置为新的ShareDialog。

shareDialog = new ShareDialog(.......); //getContext() not working 

我需要解决方法:(

1 个答案:

答案 0 :(得分:0)

请在构建器中传递活动上下文,而不是getContext。如果在活动中使用,请使用

shareDialog = new ShareDialog(MyActivity.this);

如果在片段中使用它

shareDialog = new ShareDialog(getActivity);