启动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);
logcat的:
05-14 16:42:13.470:E / AndroidRuntime(28141):致命异常:主要 05-14 16:42:13.470:E / AndroidRuntime(28141):java.lang.RuntimeException:无法启动活动ComponentInfo {com.facebook.katana / com.facebook.katana.ProxyAuth}:java.lang.NullPointerException 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2787) 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2803) 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.app.ActivityThread.access $ 2300(ActivityThread.java:135) 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:2136) 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.os.Handler.dispatchMessage(Handler.java:99) 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.os.Looper.loop(Looper.java:144) 05-14 16:42:13.470:E / AndroidRuntime(28141):在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):引起: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):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069) 05-14 16:42:13.470:E / AndroidRuntime(28141):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751) 05-14 16:42:13.470:E / AndroidRuntime(28141):... 11更多 05-14 16:42:15.520:E / ActivityManager(114):运行过程出错 05-14 16:42:15.520:E / ActivityManager(114):java.io.IOException:运行exec()时出错。命令:[/ system / xbin / procrank]工作目录:null环境:[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):引起:java.io.IOException:没有这样的文件或目录 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
答案 0 :(得分:0)
它可能不是您需要的答案,但您可以尝试android:launchMode =“singleTask”,在许多情况下它的行为类似于singleInstance,并且可以使用facebook身份验证。见Android singleTask or singleInstance launch mode?