2

I write and adapter view to display images, include this I added two extra button to move right and left. I created drawable xml for both button, so while executing code at runtime it's producing following error :

D/AndroidRuntime(3682): Shutting down VM W/dalvikvm( 3682):threadid=1:
   thread exiting with uncaught exception (group=0x41bad300)
E/AndroidRuntime(3682): FATAL EXCEPTION: main
E/AndroidRuntime(3682): java.lang.StackOverflowError
E/AndroidRuntime(3682):at android.util.SparseArray.get(SparseArray.java:82)
E/AndroidRuntime(3682):at android.util.SparseArray.get(SparseArray.java:73)
E/AndroidRuntime(3682):at android.content.res.StringBlock.get(StringBlock.java:69)
E/AndroidRuntime(3682):at android.content.res.AssetManager.getResourceValue(AssetManager.java:201)
E/AndroidRuntime(3682):at android.content.res.Resources.getValue(Resources.java:1009)
E/AndroidRuntime(3682):at android.content.res.Resources.getDrawable(Resources.java:658)
E/AndroidRuntime(3682):at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)

does any one have idea about it...if I refer normal drawable image then it work properly.

Bernhard Barker
  • 54,589
  • 14
  • 104
  • 138
CoDe
  • 11,056
  • 14
  • 90
  • 197

1 Answers1

0

StackOverflowError can happen when too much data is managed in one single task. For example, this could be if you got an endless loop or handling too much data transfer inside a loop. This is one of the reason, there could be more.

see this example of handling stackOverflowError with a database:

http://wiki.webratio.com/index.php/How_to_solve_the_java.lang.StackOverflowError

additionally, I found this post in stackoverflow:

Stack overflows from deep recursion in Java?

But without seeing some code, it´s hard to find the issue, so please post some...

Community
  • 1
  • 1
Opiatefuchs
  • 9,800
  • 2
  • 36
  • 49