GrenderG / Toasty

The usual Toast, but with steroids 💪
GNU Lesser General Public License v3.0
6.58k stars 811 forks source link

IllegalStateException: View android.widget.LinearLayout as already been added to the window manager #114

Open hufeiyang opened 5 years ago

hufeiyang commented 5 years ago

@05-27 15:39:32.884 12472-12472/io.silvrr.installment E/AndroidRuntime: FATAL EXCEPTION: main Process: io.silvrr.installment, PID: #12472 java.lang.IllegalStateException: View android.widget.LinearLayout{a4c9269 V.E...... ......I. 0,0-0,0} has already been added to the window manager. at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:328) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94) at android.widget.Toast$TN.handleShow(Toast.java:508) at android.widget.Toast$TN$1.handleMessage(Toast.java:412) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6858) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

how fix this exception?

sami286 commented 5 years ago

We need to be able to reproduce that situation to be able to fix any possible issue, Please provide more information (platform, repro steps...)

rosuH commented 5 years ago

Same issues here.

java.lang.IllegalStateException
View android.widget.LinearLayout{d7eca09 V.E...... ......ID 0,0-729,138 #7f0904af app:id/toast_root} has already been added to the window manager.
android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:371)
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:131)
android.widget.Toast$TN.handleShow(Toast.java:501)
android.widget.Toast$TN$1.handleMessage(Toast.java:403)
android.os.Handler.dispatchMessage(Handler.java:112)
android.os.Looper.loop(Looper.java:216)
android.app.ActivityThread.main(ActivityThread.java:7593)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

It may appear when Toast is frequently popped up. But we can't reproduce 100%.

Toasty

Devices Info

Device: HUAWEI ELE AL00( P30 )
OS: HuaWei/EMOTION Android 9,level 28
sami286 commented 5 years ago

Please try to use the latest version 1.4.2 when reporting bugs as the error may be already solved

I will try to reproduce it the next week and see if there's any possible solution :)

wangzai0904 commented 4 years ago

@05-27 15:39:32.884 12472-12472/io.silvrr.installment E/AndroidRuntime: FATAL EXCEPTION: main Process: io.silvrr.installment, PID: #12472 java.lang.IllegalStateException: View android.widget.LinearLayout{a4c9269 V.E...... ......I. 0,0-0,0} has already been added to the window manager. at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:328) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94) at android.widget.Toast$TN.handleShow(Toast.java:508) at android.widget.Toast$TN$1.handleMessage(Toast.java:412) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6858) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

how fix this exception?

Has the problem been solved?

rosuH commented 4 years ago

@kexianwang Not yet. Using 1.4.2.