我的facebook android应用程序不是登录facebook [英] My facebook android app is not login facebook

查看:71
本文介绍了我的facebook android应用程序不是登录facebook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跟着facebook开始然后运行以下代码,加载框将出现几分钟然后没有任何反应,但是logcat中显示了一些错误,如下所示;可能是什么问题?我确定我的密钥哈希。问题是另一回事。我只知道会议没有开放。请帮忙:)

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.

推荐答案

我想你需要看看:

登录 - 额外许可-with-facebook-sdk-3-for-android [ ^ ]
I think you need to have a look at:
Login-with-extra-permission-with-facebook-sdk-3-for-android[^]


这篇关于我的facebook android应用程序不是登录facebook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆