java.lang.IllegalStateException: call to getView on a Window

Appcelerator JIRA | Dawson Toth | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Problem: The APIDocs do not say that [Titanium.UI.Window|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object] cannot be added to other views on Android. For example, the following will work on iOS, but will break on Android: {code:lang=javascript} <code class= "javascript">var outer = Ti.UI.createWindow({ backgroundColor: 'white' }); var inner = Ti.UI.createWindow({ backgroundColor: 'blue', top: 50 }); outer.add(inner); outer.open(); {code} When it breaks on Android, it results in the following error: {code} [TRACE] E/AndroidRuntime( 419): FATAL EXCEPTION: main [TRACE] E/AndroidRuntime( 419): java.lang.IllegalStateException: call to getView on a Window [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57) [TRACE] E/AndroidRuntime( 419): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:377) [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:64) [TRACE] E/AndroidRuntime( 419): at android.os.Handler.dispatchMessage(Handler.java:95) [TRACE] E/AndroidRuntime( 419): at android.os.Looper.loop(Looper.java:123) [TRACE] E/AndroidRuntime( 419): at android.app.ActivityThread.main(ActivityThread.java:4627) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invokeNative(Native Method) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invoke(Method.java:521) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [TRACE] E/AndroidRuntime( 419): at dalvik.system.NativeStart.main(Native Method)</code> {code} Associated Helpdesk Ticket [http://developer.appcelerator.com/helpdesk/view/68881">http://developer.appcelerator.com/helpdesk/view/68881]

    Appcelerator JIRA | 6 years ago | Dawson Toth
    java.lang.IllegalStateException: call to getView on a Window
  2. 0

    Problem: The APIDocs do not say that [Titanium.UI.Window|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Window-object] cannot be added to other views on Android. For example, the following will work on iOS, but will break on Android: {code:lang=javascript} <code class= "javascript">var outer = Ti.UI.createWindow({ backgroundColor: 'white' }); var inner = Ti.UI.createWindow({ backgroundColor: 'blue', top: 50 }); outer.add(inner); outer.open(); {code} When it breaks on Android, it results in the following error: {code} [TRACE] E/AndroidRuntime( 419): FATAL EXCEPTION: main [TRACE] E/AndroidRuntime( 419): java.lang.IllegalStateException: call to getView on a Window [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57) [TRACE] E/AndroidRuntime( 419): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:377) [TRACE] E/AndroidRuntime( 419): at ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:64) [TRACE] E/AndroidRuntime( 419): at android.os.Handler.dispatchMessage(Handler.java:95) [TRACE] E/AndroidRuntime( 419): at android.os.Looper.loop(Looper.java:123) [TRACE] E/AndroidRuntime( 419): at android.app.ActivityThread.main(ActivityThread.java:4627) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invokeNative(Native Method) [TRACE] E/AndroidRuntime( 419): at java.lang.reflect.Method.invoke(Method.java:521) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) [TRACE] E/AndroidRuntime( 419): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) [TRACE] E/AndroidRuntime( 419): at dalvik.system.NativeStart.main(Native Method)</code> {code} Associated Helpdesk Ticket [http://developer.appcelerator.com/helpdesk/view/68881">http://developer.appcelerator.com/helpdesk/view/68881]

    Appcelerator JIRA | 6 years ago | Dawson Toth
    java.lang.IllegalStateException: call to getView on a Window
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Could not find a method saveData(View)

    Google Groups | 8 months ago | Giuseppe Guarino
    java.lang.IllegalStateException: Could not find a method saveData(View) in the activity class com.example.giuse.secondly.NewSheet for onClick handler on view class android.widget.Button with id 'button_save' at android.view.View$1.onClick(View.java:4007) at android.view.View.performClick(View.java:4780) at android.view.View$PerformClick.run(View.java:19866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)

    Root Cause Analysis

    1. java.lang.IllegalStateException

      call to getView on a Window

      at ti.modules.titanium.ui.WindowProxy.getView()
    2. ti.modules.titanium
      WindowProxy.getView
      1. ti.modules.titanium.ui.WindowProxy.getView(WindowProxy.java:57)
      1 frame
    3. org.appcelerator.titanium
      TiViewProxy.realizeViews
      1. org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:377)
      1 frame
    4. ti.modules.titanium
      WindowProxy.handleMessage
      1. ti.modules.titanium.ui.WindowProxy.handleMessage(WindowProxy.java:64)
      1 frame
    5. Android Platform
      ActivityThread.main
      1. android.os.Handler.dispatchMessage(Handler.java:95)
      2. android.os.Looper.loop(Looper.java:123)
      3. android.app.ActivityThread.main(ActivityThread.java:4627)
      3 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:521)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
      2 frames