wood burning stoves 2.0*
The moose likes Android and the fly likes StringIndexOutOfBoundsException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "StringIndexOutOfBoundsException" Watch "StringIndexOutOfBoundsException" New topic
Author

StringIndexOutOfBoundsException

Frederik Bolding
Greenhorn

Joined: Jul 22, 2012
Posts: 5
Hello there.

I am having a problem with my code..
It is force closing when i run it.
With the error: StringIndexOutOfBoundsException

My code:



- Frede1012
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41042
    
  43
You didn't say in which line this happens, so I'm guessing either line 42 or 43. What is the value of "n"? If it's -1 or equal to the length of "result" you're in trouble.


Ping & DNS - my free Android networking tools app
Frederik Bolding
Greenhorn

Joined: Jul 22, 2012
Posts: 5
Ulf Dittmer wrote:You didn't say in which line this happens, so I'm guessing either line 42 or 43. What is the value of "n"? If it's -1 or equal to the length of "result" you're in trouble.


I dont really know, i got help on an irc and did this.
But it is still not working.
Im trying to get the first two lines of the memoryinfo thingy.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41042
    
  43
I'm just noticing that lines 41 to 45 are not part of any method; it looks like they need to go between lines 12 and 13.
Frederik Bolding
Greenhorn

Joined: Jul 22, 2012
Posts: 5
Okay that fixes the error.
But it still shows the whole meminfo instead of only output string?
Frederik Bolding
Greenhorn

Joined: Jul 22, 2012
Posts: 5
Nevermind!
Thanks for the help!

/solved
 
wood burning stoves
 
subject: StringIndexOutOfBoundsException
 
Similar Threads
Sending a pdf file to client from server through web service
Cannot find the problem in the code
telephonyManager.getCellLocation() gives null
virtual key board source code
how to declare array of list for an file