2013-06-25 224 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