Android Crash, java.lang.IllegalArgumentException: window type cannot be changed after adding window

I downloaded the Android application to the market, and for some reason the user is getting this error.

java.lang.IllegalArgumentException: Window type can not be changed after the window is added. at android.os.Parcel.readException(Parcel.java:1331) at android.os.Parcel.readException(Parcel.java:1281) at android.view.IWindowSession$Stub$Proxy.relayout(IWindowSession.java:664) at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:3594) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1193) at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2450) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4444) 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:787) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554) at dalvik.system.NativeStart.main(Native Method) 

I'm sure I never used WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG as indicated in other posts. However, I have a window that switches between WindowManager.LayoutParams.TYPE_PHONE and WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY . It seems like it could be a mistake. I would prefer not to change this, as it would require that I have two windows instead of one. Thanks in advance!

+5
android android-windowmanager
Jun 11 '13 at 14:42 on
source share
1 answer

check out AndroidManifest.xml

 <uses-sdk //************ android:targetSdkVersion="X"/> 

X must be less than 14 or remove this attribute. lucky guy.

+11
Oct 11 '13 at 9:17
source share



All Articles