2013-06-25 221 views
0

工作,我有一个奇怪的问题 在我的应用我已经实现了Facebook的库,和我登录用户。 我创建了哈希,我创建了API密钥(来自facebook)等etc等 一切都很完美,只有我移动了另一个项目中的类,复制了布局清单,我不再登录,如果你已经安装了Facebook的应用程序(如果它安装了作品)...我可以忘记什么? 这里是登录Facebook登录不与Facebook应用程序

// start Facebook Login 
    Session.openActiveSession(this, true, new Session.StatusCallback() { 

     // callback when session changes state 
     @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) { 
       String nickname = user.getName(); 
       String id = user.getId(); 
       // TextView welcome = (TextView) findViewById(R.id.textView1); 
       // welcome.setText("Hello " + user.getName() + "!"); 

       SharedPreferences prefs = getSharedPreferences("Preferenze", Context.MODE_PRIVATE); 
       SharedPreferences.Editor editor = prefs.edit(); 

       if (nickname != null) { 
        editor.putString("utente", ""+nickname); 
       editor.commit(); 
       } 
       String fotoProfilo = "https://graph.facebook.com/" + id + "/picture"; 
       if (id != null){ 
       editor.putString("path", ""+fotoProfilo); 
       editor.commit(); 

       } 

      Intent LogIn= new Intent(getBaseContext(), MenuLoggato.class); 
      LogIn.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
      LogIn.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); 
      LogIn.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 

      startActivity(LogIn); 
      finish(); 
       //fin qui ci arriva 
       } 
      } 
      }); 
     } else { 
      System.out.println("non è entrato"); 
     } 

     System.out.println("Log in non riuscito"); 
     } 
    }); 
    } 

    @Override 
    public void onActivityResult(int requestCode, int resultCode, Intent data) { 
     super.onActivityResult(requestCode, resultCode, data); 
     Session.getActiveSession().onActivityResult(this, requestCode, resultCode, data); 
    } 

对不起的,我的英语

+0

您是否使用与您签署的应用程序相同的密钥签署了该应用程序? – Cata

+0

@Cata是的,我这样做,因为我使用开发密钥 – Lele

+0

你可以发布一些日志输出?或者究竟是什么错误? – Cata

回答

0

该问题的代码是,我有开放的GL库的版本有误。 我已经下载和istaller一个新版本,它生成了一个不同的哈希码,它的工作。 Thaks to all