Click here to Skip to main content
14,733,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I followed facebook's getting started then run following code that a Loading box will appear for a few minutes and then nothing happens but some errors are shown in logcat as follow; what can be the problem? I sure about my key hash. The problem is another thing. I only know the session is not open. Please help:)
Code:
package com.example.login;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;

import com.facebook.Request;
import com.facebook.Response;
import com.facebook.Session;
import com.facebook.SessionState;
import com.facebook.model.GraphUser;


public class MainActivity extends Activity {

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    
    // 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) {
                TextView welcome = (TextView) findViewById(R.id.welcome);
                welcome.setText("Hello " + user.getName() + "!");
              }
            }
          });
        }
        else Toast.makeText(getApplicationContext(), "session is not opened", Toast.LENGTH_LONG).show();
      }
      
    
    });
  }

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

}

Error Logcat:

.09-05 09:16:03.193: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:03.653: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:03.653: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:04.394: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:04.394: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:04.594: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:04.653: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:05.403: D/dalvikvm(2045): GC_CONCURRENT freed 170K, 10% free 2613K/2900K, paused 8ms+35ms, total 366ms
09-05 09:16:06.884: D/dalvikvm(2045): GC_CONCURRENT freed 52K, 8% free 2977K/3204K, paused 79ms+51ms, total 251ms
09-05 09:16:07.347: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.474: I/Choreographer(2045): Skipped 190 frames!  The application may be doing too much work on its main thread.
09-05 09:16:07.474: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.514: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.554: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.764: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.804: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.873: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:07.873: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:09.363: I/Choreographer(2045): Skipped 894 frames!  The application may be doing too much work on its main thread.
09-05 09:16:09.453: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:09.484: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:09.515: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:09.623: D/gralloc_goldfish(2045): Emulator without GPU emulation detected.
09-05 09:16:09.714: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:09.854: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:09.864: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:11.604: I/Choreographer(2045): Skipped 130 frames!  The application may be doing too much work on its main thread.
09-05 09:16:11.604: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:11.604: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:11.923: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:11.923: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:11.923: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:11.944: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:12.234: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:13.488: D/FacebookSDK.WebDialog(2045): Webview loading URL: https://m.facebook.com/dialog/oauth?type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess&display=touch&client_id=538392626208680
09-05 09:16:14.154: I/Choreographer(2045): Skipped 32 frames!  The application may be doing too much work on its main thread.
09-05 09:16:14.163: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:14.373: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:14.444: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:14.654: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:14.663: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:14.704: W/Trace(2045): Unexpected value from nativeGetEnabledTags: 0
09-05 09:16:14.764: I/Choreographer(2045): Skipped 261 frames!  The application may be doing too much work on its main thread.
Posted

1 solution

I think you need to have a look at:
Login-with-extra-permission-with-facebook-sdk-3-for-android[^]
   
Comments
Verya Heydari 5-Sep-13 9:56am
   
I've seen it before But my problem is something else. Anyway, thanks for your help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900