`

java.lang.IllegalArgumentException: Window type can not be changed after the

 
阅读更多
java.lang.IllegalArgumentException: Window type can not be changed after the window is added.

本来在百度知道上,但是无效了。。摘抄到此,备忘
引用

java.lang.IllegalArgumentException 异常求解!
2012-6-13 18:40 提问者: MeACrazy
06-13 12:32:05.524: E/WindowManager(157): Window Session Crash

06-13 12:32:05.524: E/WindowManager(157): java.lang.IllegalArgumentException: Window type can not be changed after the window is added.
06-13 12:32:05.524: E/WindowManager(157): at com.android.server.wm.WindowManagerService.relayoutWindow(WindowManagerService.java:2558)
06-13

12:32:05.524: E/WindowManager(157): at com.android.server.wm.Session.relayout(Session.java:158)

06-13 12:32:05.524: E/WindowManager(157): at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:160)

06-13 12:32:05.524: E/WindowManager(157): at com.android.server.wm.Session.onTransact(Session.java:111)

06-13 12:32:05.524: E/WindowManager(157): at android.os.Binder.execTransact(Binder.java:338)

06-13 12:32:05.524: E/WindowManager(157): at dalvik.system.NativeStart.run(Native Method)

06-13 12:32:05.524: E/AndroidRuntime(7418): FATAL EXCEPTION: main

06-13 12:32:05.524: E/AndroidRuntime(7418): java.lang.IllegalArgumentException: Window type can not be changed after the window is added.

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.os.Parcel.readException(Parcel.java:1331)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.os.Parcel.readException(Parcel.java:1281)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:634)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:3624)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1210)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2467)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.os.Handler.dispatchMessage(Handler.java:99)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.os.Looper.loop(Looper.java:137)

06-13 12:32:05.524: E/AndroidRuntime(7418): at android.app.ActivityThread.main(ActivityThread.java:4424)

06-13 12:32:05.524: E/AndroidRuntime(7418): at java.lang.reflect.Method.invokeNative(Native Method)

06-13 12:32:05.524: E/AndroidRuntime(7418): at java.lang.reflect.Method.invoke(Method.java:511)

06-13 12:32:05.524: E/AndroidRuntime(7418): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)

06-13 12:32:05.524: E/AndroidRuntime(7418): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)

06-13 12:32:05.524: E/AndroidRuntime(7418): at dalvik.system.NativeStart.main(Native Method)

06-13 12:33:04.804: E/libEGL(80): validate_display:188 error 3008 (EGL_BAD_DISPLAY)
问题补充:
主要是:java.lang.IllegalArgumentException: Window type can not be changed after the window is added. 这个!
我来帮他解答
3 分钟前 满意回答
你Activity中有getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD)之类的代码;
在ICS 4.0 以后,无论是在onCreate()还是onAttachedToWindow()中都不能重设window的Type,想用此法屏蔽Home键无效!
分享到:
评论
1 楼 windseamless 2014-08-07  
那怎么样才能屏蔽呢

相关推荐

Global site tag (gtag.js) - Google Analytics