我希望在ShareDialog
中使用Facebook的Custom Dialog
,但在初始化时,我无法将上下文值设置为新的ShareDialog。
shareDialog = new ShareDialog(.......); //getContext() not working
我需要解决方法:(
答案 0 :(得分:0)
请在构建器中传递活动上下文,而不是getContext。如果在活动中使用,请使用
shareDialog = new ShareDialog(MyActivity.this);
如果在片段中使用它
shareDialog = new ShareDialog(getActivity);