2013-05-20 28 views
0

我試圖很簡單地測試3.0 Facebook的入門指南。 https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/找不到「這個」類NoClassDefFoundError - Android

我有一些進口和參考問題,但我不知道這是相關的。我遇到的問題是,當我嘗試運行測試活動螞蟻得到這個錯誤:

Could not find class 'com.test1.test2.FacebookLogin$1', referenced from method com.test1.test2.FacebookLogin.onCreate 

代碼:

@Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.activity_facebook_login); 


     //Error occurs here when I use 'this' 
     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) { 
           TextView welcome = (TextView) findViewById(R.id.welcome); 
           welcome.setText("Hello " + user.getName() + "!"); 
          } 

        } 
        }); 

       } 
      } 
     }); 
    } 

我怎樣才能得到一個NoClassDefFoundError當我使用this

UPDATE:

與Scrumtious教程https://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/以及我得到了同樣的錯誤,當我調用Session.StatusCallback()方法測試後。我仍然不知道我的問題是什麼。

感謝您的幫助

+0

願這幫助:http://stackoverflow.com/questions/8678630/noclassdeffounderror-android –

+0

好像你還使用'super'並不僅僅是'this' –

+0

@ZouZou謝謝,但沒有我沒有 – PaperThick

回答