大家。拜托,我需要帮助。 我遵循Facebook开发者的代码并得到错误: 构造函数WebDialog.RequestDialogBuilder(Context,Session,Bundle)未定义
这是我的代码:
Bundle params = new Bundle();
params.putString("message", "Hi, I'm using Manis App. Please join me.");
WebDialog requestsDialog = (
new WebDialog.RequestsDialogBuilder(getBaseContext(), Session.getActiveSession(), params).setOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(Bundle values, FacebookException error) {
if (error != null) {
if (error instanceof FacebookOperationCanceledException) {
Toast.makeText(getApplicationContext(),
"Request cancelled",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(),
"Network Error",
Toast.LENGTH_SHORT).show();
}
} else {
final String requestId = values.getString("request");
if (requestId != null) {
Toast.makeText(getApplicationContext(),
"Request sent",
Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(),
"Request cancelled",
Toast.LENGTH_SHORT).show();
}
}
}
}))
.build();
requestsDialog.show();
当我使用时可以接受:
WebDialog.RequestsDialogBuilder(getApplicationContext());
如果我只是使用:
WebDialog.RequestsDialogBuilder(getApplicationContext(), Session.getActiveSession());
我还得到了错误构造函数(Context,Session)undefined。 任何人都可以帮忙??