post on wall dialog disappears immediately

I am using Facebook android SDK, running its provided sample example in emulator by adding app id into it.

The problem is i am able login properly but when i click on "Wall Post" button, Facebook webview dialog opens similar to login with title "Post on Wall". This dialog disappears immediately after few seconds.

what could be the issue, where i am going wrong.

EDIT 1: Its actually a problem with the emulator. I have tested it in other emulator its works fine. But now in emulator after successful wall post FB webview dialog gets closed and return back to app but in device it doesn't. The dialog stays there showing blank screen with success post id

EDIT 2: I also noticed this dialog disappear issue is getting on v2.1(Tested on emulator). But it works fine on v2.2 and above(Tested on emulator and device)


Its not the issue with the Emulator. But its a Issue because you have install the native facebookapp in that emulator.

I am getting the same issue and now i have solve it.

What you need to do is:

Just go to facebook sdk project. then go to Facebook.java

Now here you will get one Method for the Authorization like:

 public void authorize(Activity activity, String[] permissions,
        int activityCode, final DialogListener listener) {

    boolean singleSignOnStarted = false;

    mAuthDialogListener = listener;

    THIS CODE IS EDITED BY SHREYASH FOR NOT ALLOW THE DEFAULT FACEBOOK APP
    // Prefer single sign-on, where available.
    if (activityCode >= 0) {
        singleSignOnStarted = startSingleSignOn(activity, mAppId,
                permissions, activityCode);
    }
    // Otherwise fall back to traditional dialog.
    if (!singleSignOnStarted) {
        startDialogAuth(activity, permissions);
    }
}

Just Replace the above with this below one:

    public void authorize(Activity activity, String[] permissions,
            int activityCode, final DialogListener listener) {

        boolean singleSignOnStarted = false;

        mAuthDialogListener = listener;

//        THIS CODE IS EDITED FOR NOT ALLOW THE DEFAULT FACEBOOK APP
//        // Prefer single sign-on, where available.
//        if (activityCode >= 0) {
//            singleSignOnStarted = startSingleSignOn(activity, mAppId,
//                    permissions, activityCode);
//        }
//        // Otherwise fall back to traditional dialog.
//        if (!singleSignOnStarted) {
            startDialogAuth(activity, permissions);
//        }
    }

It will surly solve your issue. If not then let me know.

Enjoy.

:)

链接地址: http://www.djcxy.com/p/49608.html

上一篇: 在android sdk中显示facebook墙

下一篇: 在墙上的对话框立即消失