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);
Session.openActiveSession(this, true, new Session.StatusCallback() {
@Override
public void call(Session session, SessionState state, Exception exception) {
if (session.isOpened()) {
Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {
@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:
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.