创建平板电脑AVD显示错误

时间:2014-03-31 03:52:17

标签: android avd

我正在尝试从我的AVD Manager创建7“平板电脑。配置如下,

  

enter image description here

但是当我加载我的avd时,它会在DDMS中显示以下错误,

03-31 09:12:17.840: E/AndroidRuntime(526): FATAL EXCEPTION: main
03-31 09:12:17.840: E/AndroidRuntime(526): java.lang.RuntimeException: Unable to create service com.android.systemui.SystemUIService: java.lang.RuntimeException: Tablet device cannot show navigation bar and system bar
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2263)
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.app.ActivityThread.access$1600(ActivityThread.java:123)
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.os.Handler.dispatchMessage(Handler.java:99)
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.os.Looper.loop(Looper.java:137)
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.app.ActivityThread.main(ActivityThread.java:4424)
03-31 09:12:17.840: E/AndroidRuntime(526):  at java.lang.reflect.Method.invokeNative(Native Method)
03-31 09:12:17.840: E/AndroidRuntime(526):  at java.lang.reflect.Method.invoke(Method.java:511)
03-31 09:12:17.840: E/AndroidRuntime(526):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-31 09:12:17.840: E/AndroidRuntime(526):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-31 09:12:17.840: E/AndroidRuntime(526):  at dalvik.system.NativeStart.main(Native Method)
03-31 09:12:17.840: E/AndroidRuntime(526): Caused by: java.lang.RuntimeException: Tablet device cannot show navigation bar and system bar
03-31 09:12:17.840: E/AndroidRuntime(526):  at com.android.systemui.statusbar.tablet.TabletStatusBar.makeStatusBarView(TabletStatusBar.java:451)
03-31 09:12:17.840: E/AndroidRuntime(526):  at com.android.systemui.statusbar.StatusBar.start(StatusBar.java:64)
03-31 09:12:17.840: E/AndroidRuntime(526):  at com.android.systemui.statusbar.tablet.TabletStatusBar.start(TabletStatusBar.java:390)
03-31 09:12:17.840: E/AndroidRuntime(526):  at com.android.systemui.SystemUIService.onCreate(SystemUIService.java:93)
03-31 09:12:17.840: E/AndroidRuntime(526):  at android.app.ActivityThread.handleCreateService(ActivityThread.java:2253)
03-31 09:12:17.840: E/AndroidRuntime(526):  ... 10 more

这可能是什么原因?

1 个答案:

答案 0 :(得分:0)

错误由此行引起:

Caused by: java.lang.RuntimeException: Tablet device cannot show navigation bar and system bar

你可以像下面这样处理:

try {
         // Sanity-check that someone hasn't set up the config wrong and asked for a navigation
         // bar on a tablet that has only the system bar
         if (mWindowManager.hasNavigationBar()) {
             throw new RuntimeException(
                     "Tablet device cannot show navigation bar and system bar");
         }
     } catch (RemoteException ex) {
     }

来源link

通过更改配置文件来解决此问题的另一种方法:

put hw.mainKeys=yes in your .android->avd->youavdfoldername->config
open file and change hw.mainKeys=yes