【问题标题】:Can not use new Android 4.0 VpnService framework无法使用新的 Android 4.0 VpnService 框架
【发布时间】:2011-12-12 01:32:49
【问题描述】:

我正在尝试将新的 Android 4.0 VPN 框架与模拟器一起使用。

在我调用的示例应用中:

 Intent intent = VpnService.prepare(SimpleVpnActivity.this);
 if(null != intent){
     startActivityForResult(intent, 1);
 }

但应用程序因异常而崩溃,因为 VpnService.prepare() 返回一个明确的意图: 意图:{ cmp=com.android.vpndialogs/.ConfirmDialog } 用于无法找到的活动 startActivityForResult().

我做错了吗?

我将不胜感激。

这是我的堆栈转储:

E/AndroidRuntime(12783): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.vpndialogs/ 
com.android.vpndialogs.ConfirmDialog}; have you declared this activity in your AndroidManifest.xml? 
E/AndroidRuntime(12783):        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1508) 
E/AndroidRuntime(12783):        at android.app.Instrumentation.execStartActivity(Instrumentation.java: 1384) 
E/AndroidRuntime(12783):        at android.app.Activity.startActivityForResult(Activity.java:3190) 
E/AndroidRuntime(12783):        at com.my.simple.vpn.SimpleVpnActivity $1.onClick(SimpleVpnActivity.java:30) 
E/AndroidRuntime(12783):        at android.view.View.performClick(View.java: 3460) 
E/AndroidRuntime(12783):        at android.view.View $PerformClick.run(View.java:13955) 
E/AndroidRuntime(12783):        at android.os.Handler.handleCallback(Handler.java:605) 
E/AndroidRuntime(12783):        at android.os.Handler.dispatchMessage(Handler.java:92) 
E/AndroidRuntime(12783):        at android.os.Looper.loop(Looper.java:137) 
E/AndroidRuntime(12783):        at android.app.ActivityThread.main(ActivityThread.java:4340) 
E/AndroidRuntime(12783):        at java.lang.reflect.Method.invokeNative(Native Method) 
E/AndroidRuntime(12783):        at java.lang.reflect.Method.invoke(Method.java:511) 
E/AndroidRuntime(12783):        at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:784) 
E/AndroidRuntime(12783):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 
E/AndroidRuntime(12783):        at dalvik.system.NativeStart.main(Native Method)

【问题讨论】:

    标签: android vpn android-4.0-ice-cream-sandwich


    【解决方案1】:

    看起来com.android.vpndialogs 包没有被构建为模拟器映像的一部分。这是 SDK 团队需要修复的错误。

    我想说在 b.android.com 上提交一个错误,但看起来你已经这样做了,并且正在调查中。 :)

    参考:http://code.google.com/p/android/issues/detail?id=21030

    【讨论】:

      猜你喜欢
      • 2012-07-21
      • 2012-04-30
      • 1970-01-01
      • 2012-10-22
      • 2017-11-09
      • 2019-12-18
      • 1970-01-01
      • 2011-04-11
      • 1970-01-01
      相关资源
      最近更新 更多