简体   繁体   English

Facebook SDK 3.0在Android的会话状态OPENING中冻结

[英]Facebook SDK 3.0 freezes on session state OPENING in Android

I am using the Facebook SDK 3.0.2 to share a simple URL on facebook through my application. 我正在使用Facebook SDK 3.0.2通过我的应用程序在facebook上共享一个简单的URL。 I am not using Fragments but using ActivityGroup in a tabhost. 我不使用片段,而是在Tabhost中使用ActivityGroup。 I want to share from an Activity within the Activity group. 我想与“活动”组中的“活动”共享。 Below is the code I am using to initiate a session: 以下是我用来发起会话的代码:

Session.openActiveSession(activity, true, new Session.StatusCallback()
        {
            // callback when session changes state
            public void call(final Session session, SessionState state, Exception exception)
            {

                if (session.isOpened())
                {
                    publishFeedDialog(name, caption, description, link, urlPicture, listenerShareFacebook);
                } else {
                    AlAinZooUtils.LOG("----- Session not opened in Manager ------ "+state);
                    if(exception != null) {
                        AlAinZooUtils.LOG("----- exception in opening the session ------ "+exception.getMessage());
                        listenerShareFacebook.onShareFacebookFailure(exception.getMessage());
                    }
                }

            }
        }

The problem I am facing is that the session never returns OPENED. 我面临的问题是该会话永远不会返回OPENED。 It always shows OPENING and freezes. 它总是显示OPENING并冻结。 There is no exception thrown as well. 也没有抛出异常。 I have no clue what the issue could be. 我不知道这个问题可能是什么。

I have also overridden the onActivityResult method in the activity and the Parent Activity but it does not get called either. 我还重写了活动和父活动中的onActivityResult方法,但未调用任何方法。 Please guide me to get it working. 请指导我使其正常运行。

Dont forget to add onActivityResult method 不要忘记添加onActivityResult方法

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM