我正在编写Android应用程序并试图将android:targetSdkVersion
增加到19以消除警告"Not targeting the latest versions of Android..."
。在我使用版本10之前,一切都运行良好但在此之后我得到以下异常:
java.lang.IllegalArgumentException: Window type can not be changed after the window is added.
at android.os.Parcel.readException(Parcel.java:1438)
at android.os.Parcel.readException(Parcel.java:1388)
at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:824)
at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:4450)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1642)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1190)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4860)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:766)
at android.view.Choreographer.doCallbacks(Choreographer.java:575)
at android.view.Choreographer.doFrame(Choreographer.java:542)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:751)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:5751)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1083)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:850)
at dalvik.system.NativeStart.main(Native Method)
我已经尝试了10到19之间的所有版本,并且发现如果我选择版本14或更高版本会发生此错误。 因为没有消息直接来自我的代码,所以我不确定在哪里查找错误。 谁能告诉我我应该寻找什么?有谁知道从v13到v14的变化可以解释这种行为?