好吧,正如标题中所说,我在放置 SSO 代码的类上遇到两个错误:
1) “未定义 Facebook 类型的 Authorize 方法”... 2) “未定义构造函数 Facebook”...
我收到 AuthorizeCallback 的相同错误...
我不知道该怎么办......我按照“FB”创建的教程(“Android教程”)......
这是代码:
package my.package.namespace;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.android.*;
import com.facebook.android.Facebook.*;
public class Facebook extends Activity {
Facebook fbclient = new Facebook("myappid");
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
fbclient.authorize(this, new DialogListener() {
@Override
public void onComplete(Bundle values) {}
@Override
public void onFacebookError(FacebookError error) {}
@Override
public void onError(DialogError e) {}
@Override
public void onCancel() {}
});
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
fbclient.authorizeCallback(requestCode, resultCode, data);
}
}