2014-03-31 52 views
0

我想從我的AVD管理器中創建7" 平板電腦,配置如下,創建平板AVD顯示錯誤

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 

可能是什麼原因呢?

回答

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 
+0

謝謝洛克斯,你能告訴我應該在哪裏寫這段代碼嗎? – user2060383

+0

你試過第二種方式嗎? – Lokesh

+0

那條路在哪裏?我不會讓你失望。 – user2060383