java.lang.IllegalArgumentException: View not attached to window manager

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h3. Expected behavior The window opens , push the button to open another window, push the hardware back android button, we need to be able to do this so many times without problems. h3. Actual behavior The window opens, push the button to open another window, push the hardware back android button, wait 2 seconds, an error alert goes up h3. Test Case {code:title=app.js|borderStyle=solid} var win1 = Ti.UI.createWindow({ fullscreen : false }); win1.add(Ti.UI.createLabel({ top : '0dp', text : 'Win1' })); win2Button = Ti.UI.createButton({ title : 'Open Win2' }); win2Button.addEventListener('click', function(){ var win2 = Ti.UI.createWindow({ fullscreen : false }); win2.add(Ti.UI.createLabel({ top : '0dp', text : 'Win2' })); var win2BackButton = Ti.UI.createButton({ title : 'Go Back' }); win2BackButton.addEventListener('click', function(){ win2.close(); }); win2.add(win2BackButton); win2.open(); }); win1.add(win2Button); win1.addEventListener('focus', function(){ var actInd = Ti.UI.createActivityIndicator({ bottom : 10, height : 50, width : 10, message : 'Loading...' }); actInd.show(); setTimeout(function(){ actInd.hide(); }, 2000); }); win1.open(); {code} h3. Log {code:title=log|borderStyle=solid} D/AndroidRuntime( 724): Shutting down VM W/dalvikvm( 724): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/TiApplication( 724): (main) [1675,11364] Sending event: exception on thread: main msg:java.lang.IllegalArgumentException: View not attached to window manager; Titanium 1.8.0.1,2011/12/17 19:53,c903964 E/TiApplication( 724): java.lang.IllegalArgumentException: View not attached to window manager E/TiApplication( 724): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) E/TiApplication( 724): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200) E/TiApplication( 724): at android.view.Window$LocalWindowManager.removeView(Window.java:432) E/TiApplication( 724): at android.app.Dialog.dismissDialog(Dialog.java:278) E/TiApplication( 724): at android.app.Dialog.access$000(Dialog.java:71) E/TiApplication( 724): at android.app.Dialog$1.run(Dialog.java:111) E/TiApplication( 724): at android.app.Dialog.dismiss(Dialog.java:268) E/TiApplication( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleHide(TiUIActivityIndicator.java:217) E/TiApplication( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleMessage(TiUIActivityIndicator.java:77) E/TiApplication( 724): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 724): at android.os.Looper.loop(Looper.java:130) E/TiApplication( 724): at android.app.ActivityThread.main(ActivityThread.java:3683) E/TiApplication( 724): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 724): at java.lang.reflect.Method.invoke(Method.java:507) E/TiApplication( 724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/TiApplication( 724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/TiApplication( 724): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 724): FATAL EXCEPTION: main E/AndroidRuntime( 724): java.lang.IllegalArgumentException: View not attached to window manager E/AndroidRuntime( 724): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) E/AndroidRuntime( 724): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200) E/AndroidRuntime( 724): at android.view.Window$LocalWindowManager.removeView(Window.java:432) E/AndroidRuntime( 724): at android.app.Dialog.dismissDialog(Dialog.java:278) E/AndroidRuntime( 724): at android.app.Dialog.access$000(Dialog.java:71) E/AndroidRuntime( 724): at android.app.Dialog$1.run(Dialog.java:111) E/AndroidRuntime( 724): at android.app.Dialog.dismiss(Dialog.java:268) E/AndroidRuntime( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleHide(TiUIActivityIndicator.java:217) E/AndroidRuntime( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleMessage(TiUIActivityIndicator.java:77) E/AndroidRuntime( 724): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 724): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime( 724): at android.app.ActivityThread.main(ActivityThread.java:3683) E/AndroidRuntime( 724): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 724): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime( 724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/AndroidRuntime( 724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/AndroidRuntime( 724): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 64): Force finishing activity com.appcelerator.app562821/org.appcelerator.titanium.TiActivity D/dalvikvm( 724): GC_CONCURRENT freed 254K, 47% free 3104K/5831K, external 1497K/1828K, paused 5ms+4ms W/ActivityManager( 64): Activity pause timeout for HistoryRecord{40753b30 com.appcelerator.app562821/org.appcelerator.titanium.TiActivity} {code}
    via by Radamantis Torres-Lechuga,
  • h3. Expected behavior The window opens , push the button to open another window, push the hardware back android button, we need to be able to do this so many times without problems. h3. Actual behavior The window opens, push the button to open another window, push the hardware back android button, wait 2 seconds, an error alert goes up h3. Test Case {code:title=app.js|borderStyle=solid} var win1 = Ti.UI.createWindow({ fullscreen : false }); win1.add(Ti.UI.createLabel({ top : '0dp', text : 'Win1' })); win2Button = Ti.UI.createButton({ title : 'Open Win2' }); win2Button.addEventListener('click', function(){ var win2 = Ti.UI.createWindow({ fullscreen : false }); win2.add(Ti.UI.createLabel({ top : '0dp', text : 'Win2' })); var win2BackButton = Ti.UI.createButton({ title : 'Go Back' }); win2BackButton.addEventListener('click', function(){ win2.close(); }); win2.add(win2BackButton); win2.open(); }); win1.add(win2Button); win1.addEventListener('focus', function(){ var actInd = Ti.UI.createActivityIndicator({ bottom : 10, height : 50, width : 10, message : 'Loading...' }); actInd.show(); setTimeout(function(){ actInd.hide(); }, 2000); }); win1.open(); {code} h3. Log {code:title=log|borderStyle=solid} D/AndroidRuntime( 724): Shutting down VM W/dalvikvm( 724): threadid=1: thread exiting with uncaught exception (group=0x40015560) E/TiApplication( 724): (main) [1675,11364] Sending event: exception on thread: main msg:java.lang.IllegalArgumentException: View not attached to window manager; Titanium 1.8.0.1,2011/12/17 19:53,c903964 E/TiApplication( 724): java.lang.IllegalArgumentException: View not attached to window manager E/TiApplication( 724): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) E/TiApplication( 724): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200) E/TiApplication( 724): at android.view.Window$LocalWindowManager.removeView(Window.java:432) E/TiApplication( 724): at android.app.Dialog.dismissDialog(Dialog.java:278) E/TiApplication( 724): at android.app.Dialog.access$000(Dialog.java:71) E/TiApplication( 724): at android.app.Dialog$1.run(Dialog.java:111) E/TiApplication( 724): at android.app.Dialog.dismiss(Dialog.java:268) E/TiApplication( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleHide(TiUIActivityIndicator.java:217) E/TiApplication( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleMessage(TiUIActivityIndicator.java:77) E/TiApplication( 724): at android.os.Handler.dispatchMessage(Handler.java:95) E/TiApplication( 724): at android.os.Looper.loop(Looper.java:130) E/TiApplication( 724): at android.app.ActivityThread.main(ActivityThread.java:3683) E/TiApplication( 724): at java.lang.reflect.Method.invokeNative(Native Method) E/TiApplication( 724): at java.lang.reflect.Method.invoke(Method.java:507) E/TiApplication( 724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/TiApplication( 724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/TiApplication( 724): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 724): FATAL EXCEPTION: main E/AndroidRuntime( 724): java.lang.IllegalArgumentException: View not attached to window manager E/AndroidRuntime( 724): at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) E/AndroidRuntime( 724): at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200) E/AndroidRuntime( 724): at android.view.Window$LocalWindowManager.removeView(Window.java:432) E/AndroidRuntime( 724): at android.app.Dialog.dismissDialog(Dialog.java:278) E/AndroidRuntime( 724): at android.app.Dialog.access$000(Dialog.java:71) E/AndroidRuntime( 724): at android.app.Dialog$1.run(Dialog.java:111) E/AndroidRuntime( 724): at android.app.Dialog.dismiss(Dialog.java:268) E/AndroidRuntime( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleHide(TiUIActivityIndicator.java:217) E/AndroidRuntime( 724): at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleMessage(TiUIActivityIndicator.java:77) E/AndroidRuntime( 724): at android.os.Handler.dispatchMessage(Handler.java:95) E/AndroidRuntime( 724): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime( 724): at android.app.ActivityThread.main(ActivityThread.java:3683) E/AndroidRuntime( 724): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 724): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime( 724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) E/AndroidRuntime( 724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) E/AndroidRuntime( 724): at dalvik.system.NativeStart.main(Native Method) W/ActivityManager( 64): Force finishing activity com.appcelerator.app562821/org.appcelerator.titanium.TiActivity D/dalvikvm( 724): GC_CONCURRENT freed 254K, 47% free 3104K/5831K, external 1497K/1828K, paused 5ms+4ms W/ActivityManager( 64): Activity pause timeout for HistoryRecord{40753b30 com.appcelerator.app562821/org.appcelerator.titanium.TiActivity} {code}
    via by Radamantis Torres-Lechuga,
  • Rotation bug
    via GitHub by abarisain
    ,
    • java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200) at android.view.Window$LocalWindowManager.removeView(Window.java:432) at android.app.Dialog.dismissDialog(Dialog.java:278) at android.app.Dialog.access$000(Dialog.java:71) at android.app.Dialog$1.run(Dialog.java:111) at android.app.Dialog.dismiss(Dialog.java:268) at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleHide(TiUIActivityIndicator.java:217) at ti.modules.titanium.ui.widget.TiUIActivityIndicator.handleMessage(TiUIActivityIndicator.java:77) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:130) at android.app.ActivityThread.main(ActivityThread.java:3683) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method)

    Users with the same issue

    justCodeit
    justCodeit3 times, last one,
    Macapon
    Macapon1 times, last one,
    Unknown visitor2 times, last one,
    winer222
    winer22218 times, last one,
    Unknown visitor1 times, last one,
    21 more bugmates