Nullpointer ......Stack overflow, expanding

by for android » Tue, 04 Nov 2008 17:09:49 GMT


Sponsored Links
 I have created a complex view layout.Whn i see the layout(in eclipse)it
appears fine .When i see the log statements also I get the statements till
the last line in the onCreate without any issues .

But at run time i get this error which is Nullpointer.What does this error
really indicate??

11-04 14:28:11.044: INFO/dalvikvm(176): Stack overflow, expanding
(0x41049200 to 0x41049000)
11-04 14:28:11.054: INFO/dalvikvm(176): Shrank stack (to 0x41049200,
curFrame is 0x4104ad4c)
11-04 14:28:11.076: DEBUG/AndroidRuntime(176): Shutting down VM
11-04 14:28:11.076: WARN/dalvikvm(176): threadid=3: thread exiting with
uncaught exception (group=0x40010e28)
11-04 14:28:11.082: ERROR/AndroidRuntime(176): Uncaught handler: thread main
exiting due to uncaught exception
11-04 14:28:11.134: ERROR/AndroidRuntime(176):
java.lang.NullPointerException
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
android.view.ViewRoot.draw(ViewRoot.java:992)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
android.view.ViewRoot.performTraversals(ViewRoot.java:829)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:1103)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
android.os.Handler.dispatchMessage(Handler.java:88)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
android.os.Looper.loop(Looper.java:123)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
android.app.ActivityThread.main(ActivityThread.java:3742)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
java.lang.reflect.Method.invoke(Method.java:515)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
11-04 14:28:11.134: ERROR/AndroidRuntime(176):     at
dalvik.system.NativeStart.main(Native Method)

--~--~---------~--~----~------------~-------~--~----~



Nullpointer ......Stack overflow, expanding

by fadden » Wed, 05 Nov 2008 04:41:18 GMT


 


The interpreted stack overflowed, causing a StackOverflowException.
Something likely caught it and then failed with a
NullPointerException.  The stack trace points to a "finally" block in
ViewRoot.draw(), which means something in the associated "try" block
threw the NPE.

The likely cause is that your view hierarchy is too deep.  If you can
break on StackOverflowException in the Eclipse debugger you should be
able to see the point of the throw and the full contents of the stack.

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Nullpointer ......Stack overflow, expanding

by for android » Wed, 05 Nov 2008 12:07:00 GMT


 Thanks for the response.

I have not been really able to understand what is happening.When i was
trying to debug,I started removing some views in the layuot and the null
pointer was not getting thrown,

Then again i started adding the views one after the other and the code
started working fine.


But when i took the code to a difff machine ,it started to throw the same
error..



Also i would like to know what you mean by "the view heirarchy is too
big"..I have assumed that the view heirarchy can any be as complex as it can
get.Is it a fair assumption.


Thanks Once again!







--~--~---------~--~----~------------~-------~--~----~



Nullpointer ......Stack overflow, expanding

by hackbod » Wed, 05 Nov 2008 16:06:09 GMT


 


No, calls go down the view hierarchy, so a very deep hierarchy can
overflow the stack.  You also want to keep your hierarchy as simple as
possible just for plain performance reasons.

--~--~---------~--~----~------------~-------~--~----~



Nullpointer ......Stack overflow, expanding

by for android » Wed, 05 Nov 2008 16:34:11 GMT


 So how exactly do I decide that the hierarchy is very deep or not? is it
something quantifiable?


Thanks







--~--~---------~--~----~------------~-------~--~----~



Nullpointer ......Stack overflow, expanding

by for android » Mon, 10 Nov 2008 18:15:36 GMT


 Any help??????????







--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Setting Custom layout for ListView

ListActivity has a default layout and when i create a new custom
layout like below, it gives an error. "The application stopped
unexpectedly".

<?xml version="1.0" encoding="UTF-8"?>
 <LinearLayout xmlns:android=" http://www.***.com/ 
android"
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent">

   <ListView id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#00FF00"
        android:layout_weight="1"
        android:drawSelectorOnTop="false"/>

   <TextView id="@android:id/empty"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#FF0000"
        android:text="No data"/>
 </LinearLayout>

it goes out of de{*filter*} and gives error when it comes to the line
setContentView(R.layout.custom_layout). When i comment this line it
displays a List.

How to create a custom ListView?

Any help will be appreciated. Thanks!!!

--~--~---------~--~----~------------~-------~--~----~

2. Install problem

hi i have a problem to install the Android SDK1.0. i download the SDK
and unzip the file bt i got,"The file s corrupt". wat can i do for
this?

--~--~---------~--~----~------------~-------~--~----~

3. New Animation Interpolators

4. Does anyone know how to use LocationManager to show your location on Google Map?

5. Developing a 2D game on Android

6. Article comparing smart phone OSes including Android

7. ListView - If you have a item that can focus you can select the Item