我想在我的应用程序中创建第一页,您必须在其中成功登录/注册到Facebook才能带您进入下一个Intent。我从这里开始遵循教程:https://developers.facebook.com/docs/facebook-login/android,但我无法实现第3点的内容。(如果我这样做,那么它不会显示任何内容,只是一个空白屏幕)。如果我现在运行它,它会显示我的facebook按钮,但是当我点击它并且它让我进入登录页面时,如果我想在框中键入任何内容,我会收到如下错误:
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon: **** ERROR unknown type 0x73000d (glSizeof,73)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon: **** ERROR unknown type 0x73000d (glSizeof,73)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon: **** ERROR unknown type 0x73000d (glSizeof,73)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon: **** ERROR unknown type 0x73000d (glSizeof,73)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon: **** ERROR unknown type 0x73000d (glSizeof,73)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000b44
E/eglCodecCommon: glUtilsParamSize: unknow param 0x00000bd0
E/eglCodecCommon: **** ERROR unknown type 0x73000d (glSizeof,73)
这是我的java文件:
public class LogIn extends AppCompatActivity {
// @Override
CallbackManager callbackManager;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
setContentView(R.layout.activity_log_in);
AppEventsLogger.activateApp(this);
}
public View onCreateView(
LayoutInflater inflater,
ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.activity_log_in, container, false);
LoginButton loginButton = (LoginButton) view.findViewById(R.id.login_button);
loginButton.setReadPermissions("email");
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
// App code
Toast.makeText(getApplicationContext(), "success", Toast.LENGTH_LONG).show();
}
@Override
public void onCancel() {
// App code
Toast.makeText(getApplicationContext(), "no success", Toast.LENGTH_LONG).show();
}
@Override
public void onError(FacebookException exception) {
// App code
}
});
return view;
}
}
我还添加了AndroidManifest.xml文件和strings.xml
的教程答案 0 :(得分:0)