2012-02-01 45 views
0

我试图调用FB autorize对话与此代码:呼叫Facebook的autorize对话 - 未显示

//return true if is autologged 
//return false if facebook login dialog is called 
public boolean LoginAsync(Activity act) 
{ 
    m_strLastError=""; 
    boolean bTryLogin= true; 
    if ((m_fbkey != null) && (m_fbkey.length() > 0)) 
    { 
     facebook.setAccessToken(m_fbkey); 
     bTryLogin = !facebook.isSessionValid(); 
    } 
    if (bTryLogin) 
    { 
     facebook.authorize(act, new String[] { "email", "offline_access", "publish_stream", "read_stream"}, new LoginDialogListener()); 
     return false; 
    } 

    //"succesfull 'autologin' 
    return true; 
} 

它在测试程序工作正常时,点击按钮,而是停当它移动到OnCreate中工作。 对话框不再出现。只有空的屏幕。 因为在OnCreate中使用而可能失败吗?

+1

提防['的许可offline_access'弃用](http://developers.facebook.com/docs/offline-access-deprecation/)这一问题的 – 2012-02-01 07:55:34

+0

Ansvwer涉及这一问题的: HTTP:// facebook.stackoverflow.com/questions/9130133/android-autorize-call-twice – Kostadin 2012-02-03 14:27:08

回答