4

启动 com.facebook.katana.ProxyAuth 时出现问题。启动此意图的活动在清单文件中定义为 android:launchMode="singleInstance" 我已通过将启动模式删除为单个实例来解决此问题,此意图已成功启动。

我真的需要这个活动是单实例,所以有人知道如何在不删除 android:launchMode="singleInstance" 的情况下解决这个问题吗?

    Intent intent = new Intent();

    intent.setClassName("com.facebook.katana",
            "com.facebook.katana.ProxyAuth");
    intent.putExtra("client_id", applicationId);

    // Verify that the application whose package name is
    // com.facebook.katana.ProxyAuth
    // has the expected FB app signature.
    if (!validateActivityIntent(activity, intent)) {
        return false;
    }

    // activity is defined in manifest as single instance
    activity.startActivityForResult(intent, activityCode);

日志猫:

05-14 16:42:13.470: E/AndroidRuntime(28141): FATAL EXCEPTION: main
05-14 16:42:13.470: E/AndroidRuntime(28141): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.facebook.katana/com.facebook.katana.ProxyAuth}: java.lang.NullPointerException
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.ActivityThread.access$2300(ActivityThread.java:135)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2136)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.os.Looper.loop(Looper.java:144)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.ActivityThread.main(ActivityThread.java:4937)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at java.lang.reflect.Method.invokeNative(Native Method)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at java.lang.reflect.Method.invoke(Method.java:521)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at dalvik.system.NativeStart.main(Native Method)
05-14 16:42:13.470: E/AndroidRuntime(28141): Caused by: java.lang.NullPointerException
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.facebook.orca.common.util.Base64.c(Base64.java:497)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.facebook.orca.common.util.Base64.b(Base64.java:459)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.facebook.katana.ProxyAuth.b(ProxyAuth.java:36)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.facebook.katana.activity.PlatformDialogActivity.a(PlatformDialogActivity.java:127)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at com.facebook.orca.activity.FbFragmentActivity.onCreate(FbFragmentActivity.java:48)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)
05-14 16:42:13.470: E/AndroidRuntime(28141):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)
05-14 16:42:13.470: E/AndroidRuntime(28141):    ... 11 more
05-14 16:42:15.520: E/ActivityManager(114): Error running process
05-14 16:42:15.520: E/ActivityManager(114): java.io.IOException: Error running exec(). Command: [/system/xbin/procrank] Working Directory: null Environment: [ANDROID_SOCKET_zygote=11, ANDROID_BOOTLOGO=1, EXTERNAL_STORAGE=/mnt/sdcard, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, PATH=/sbin:/system/sbin:/system/bin:/system/xbin, ANDROID_DATA=/data, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/com.htc.framework.jar:/system/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easopen.jar:/system/framework/com.scalado.util.ScaladoUtil.jar, ANDROID_PROPERTY_WORKSPACE=10,65536, ANDROID_ROOT=/system, LD_LIBRARY_PATH=/system/lib]
05-14 16:42:15.520: E/ActivityManager(114):     at java.lang.ProcessManager.exec(ProcessManager.java:226)
05-14 16:42:15.520: E/ActivityManager(114):     at java.lang.ProcessBuilder.start(ProcessBuilder.java:201)
05-14 16:42:15.520: E/ActivityManager(114):     at com.android.server.am.ActivityManagerService.logProcessResult(ActivityManagerService.java:9437)
05-14 16:42:15.520: E/ActivityManager(114):     at com.android.server.am.ActivityManagerService.access$900(ActivityManagerService.java:155)
05-14 16:42:15.520: E/ActivityManager(114):     at com.android.server.am.ActivityManagerService$9.run(ActivityManagerService.java:9614)
05-14 16:42:15.520: E/ActivityManager(114): Caused by: java.io.IOException: No such file or directory
05-14 16:42:15.520: E/ActivityManager(114):     at java.lang.ProcessManager.exec(Native Method)
05-14 16:42:15.520: E/ActivityManager(114):     at java.lang.ProcessManager.exec(ProcessManager.java:224)
05-14 16:42:15.520: E/ActivityManager(114):     ... 4 more
4

1 回答 1

0

它可能不是您需要的答案,但您可以尝试使用 android:launchMode="singleTask",它在许多情况下的行为类似于 singleInstance,并且适用于 facebook 身份验证。查看Android singleTask 或 singleInstance 启动模式?

于 2013-04-08T13:46:38.247 回答