0

我只是想在我的应用程序中使用 Facebook 登录。我的应用程序因此错误而崩溃“无法保存哪个视图具有焦点,因为焦点视图 org.cocos2dx.lib.Cocos2dxGLSurfaceView@405ed960 没有 id”这是我的 Facebook 集成代码:

public class wtpbgamazon extends Cocos2dxActivity{
    private Cocos2dxGLSurfaceView mGLView;
    private static Chartboost cb;


    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        PurchasingManager.registerObserver(new amazonobserver());

        // start Facebook Login



        Session.openActiveSession(this, true, new Session.StatusCallback() {

            @Override
            public void call(Session session, SessionState state, Exception exception) {

                if (session.isOpened()) {

                      // make request to the /me API
                      Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {

                        // callback after Graph API response with user object
                        @Override
                        public void onCompleted(GraphUser user, Response response) {
                          if (user != null) {
                           //todo
                          }
                        }
                      });
                    }

            }
        });
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        Log.v("onActivityResult Was Called", "good");
      super.onActivityResult(requestCode, resultCode, data);
      Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data);
    }

有人可以帮我吗?谢谢

4

1 回答 1

0

我最近在我的游戏中集成了 FB。我打开了另一个活动,而不是在主要活动中处理 FB 代码。

于 2013-05-15T04:17:18.800 回答