Giter Site home page Giter Site logo

Comments (4)

yariv avatar yariv commented on April 24, 2024

Sounds like a good idea. We'll look into it.

from facebook-android-sdk.

zarrabeitia avatar zarrabeitia commented on April 24, 2024

I was also stuck with this problem. This patch "solves" it (calls the onCancel when the dialog is dismissed). Any thoughts?

(Edit: I had uploaded an old, broken, patch... Fixed it.)

diff --git a/facebook/src/com/facebook/android/FbDialog.java b/facebook/src/com/facebook/android/FbDialog.java
index 4a1fe93..d6ae982 100644
--- a/facebook/src/com/facebook/android/FbDialog.java
+++ b/facebook/src/com/facebook/android/FbDialog.java
@@ -19,6 +19,7 @@ package com.facebook.android;
 import android.app.Dialog;
 import android.app.ProgressDialog;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.Bitmap;
 import android.graphics.Color;
@@ -82,6 +83,16 @@ public class FbDialog extends Dialog {
         addContentView(mContent, new FrameLayout.LayoutParams(
                        (int) (dimensions[0] * scale + 0.5f),
                        (int) (dimensions[1] * scale + 0.5f)));
+
+        this.setOnCancelListener(new OnCancelListener()
+        {
+            
+            @Override
+            public void onCancel(DialogInterface dialog)
+            {
+                mListener.onCancel();
+            }
+        });
     }
 
     private void setUpTitle() {

from facebook-android-sdk.

enthusiastic-nik avatar enthusiastic-nik commented on April 24, 2024

It Causes Crash also when we cancel FB Login dialog and move to another activity...

Uncaught handler: thread main exiting due to uncaught exception
android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@43d3a210 is not valid; is your activity running?
at android.view.ViewRoot.setView(ViewRoot.java:468)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.view.Window$LocalWindowManager.addView(Window.java:424)
at android.app.Dialog.show(Dialog.java:239)
at com.facebook.android.FbDialog$FbWebViewClient.onPageStarted(FbDialog.java:155)
at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4363)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

from facebook-android-sdk.

bgold avatar bgold commented on April 24, 2024

We fixed this a couple months ago. Let me know if you're still seeing any problems.

from facebook-android-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.