Ok, I found my error. DanH, you were correct, it was actually String.indexOf() returning -1 and then I was using that -1 inside of a String.substring() function. I'm wondering why it didn't tell me where in my code it crashed. I mean it was inside the draw() method of one of my map overlay classes but in the debug window it said ViewRoot.draw(boolean) which totally threw me off.
Anyway, thanks for the help. On Sep 7, 3:22 pm, Wall-E <[email protected]> wrote: > I appreciate your help Dan but I've already considered what you > suggested. The problem is I can't debug which string is throwing that > error because it throws it in ViewRoot.draw and I have no clue what > that is other than I'm guessing that's a private MapActivity class > that I can't access. I'm narrowing it down to being an issue with > timing because I am creating an overlay and maybe I'm accessing it > before it is initialized. That's just a guess but the question I'm > having is why would ViewRoot.draw(boolean) be throwing the exception? > If that is processing something I've created, I should be able to see > it right? Going back to how my app works, I send an SMS containing > GPS coordinates along with some other information and I mostly send > the same SMS over and over again and sometimes it breaks it, other > times it works perfectly fine. That's what leads me to believe that > my string handling code is fine. > > On Sep 7, 2:07 pm, DanH <[email protected]> wrote: > > > > > Can't help with your specific questions, but 9 times out of 10, when > > StringIndexOutOfBounds is thrown from system code, the problem is a > > fairly obvious one of the user supplying a string that's too short or > > an index into the string that's too large (or occasionally a negative > > index or zero-length string). An especially common error is failing > > to account for the very last byte and somehow implying a maximum index > > that is one character too long. And of course the ever popular > > mistake of assuming 1-origin rather than 0-origin. > > > On Sep 7, 11:23 am, Wall-E <[email protected]> wrote: > > > > So in my application, I receive an SMS which contains GPS > > > coordinates. I have a receiver that handles the SMS and parsing. I > > > also have a map activity that plots those points. In the map activity > > > I create/plot a placemark of the point and I also have a balloon > > > overlay that pops up when the user clicks on the placemark. Sometimes > > > when clicking on this placemark, there is a > > > StringIndexOutofBoundsException being thrown. I'm not sure how to > > > view the stack trace but I've stepped through my code and cannot view > > > the code where this is happening. > > > > This is what my Debug window looks like at the time of the crash: > > > > Thread [<3> main] (Suspended (exception > > > StringIndexOutOfBoundsException)) > > > ViewRoot.draw(boolean) line: 1378 > > > ViewRoot.performTraversals() line: 1119 > > > ViewRoot.handleMessage(Message) line: 1638 > > > ViewRoot(Handler).dispatchMessage(Message) line: 99 > > > Looper.loop() line: 130 > > > ActivityThread.main(String[]) line: 4425 > > > Method.invokeNative(Object, Object[], Class, Class[], Class, int, > > > boolean) line: not available [native method] > > > Method.invoke(Object, Object...) line: 521 > > > ZygoteInit$MethodAndArgsCaller.run() line: 860 > > > ZygoteInit.main(String[]) line: 618 > > > NativeStart.main(String[]) line: not available [native method] > > > > Does anybody know where ViewRoot is being called? I have an OnTap() > > > method and the overlay classes which I've stepped through and > > > everything seems fine but I can only step through it to a certain > > > point. > > > > Any suggestions on how to debug this is greatly appreciated. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

