I wanted to create a first page to my application in which you must log in/register successfully to facebook in order to take you to the next Intent.
(我想为我的应用程序创建一个首页,您必须在该首页中成功登录/注册到Facebook,才能带您进入下一个Intent。)
I've followed the tutorial from here: https://developers.facebook.com/docs/facebook-login/android , but i've couldn't implement what was on point 3. (if i did that, then it wouldn't show me anything, just a blank screen).(我从这里开始遵循该教程: https : //developers.facebook.com/docs/facebook-login/android ,但是我无法实现第3点的内容。(如果我这样做了,那么它就不会什么也没给我看,只是一个空白屏幕)。)
If i run it now, it shows me the facebook button, but when I click on it and it gets me to the login page, if I want to type anyhing in the boxes I get errors like:(如果我现在运行它,它会显示给我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)
This is my java file:
(这是我的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;
}
}
I've also added what was in that tutorial for the AndroidManifest.xml file and strings.xml
(我还为AndroidManifest.xml文件和strings.xml添加了该教程中的内容)
ask by Andreea Mateescu translate from so