aspose file tools*
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 Spring in Action this week in the Spring 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: 42280
    
  64
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: 42280
    
  64
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: StringIndexOutOfBoundsException