08-22-2013, 09:52 AM
I'm assuming that means you're having problems with this line:
[code2=java]if (score > Integer.parseInt((highScore.split(":")[1])))[/code2]
If this is so, then the problem is that the highScore variable does not actually contain a colon! So the data past the colon could not be retrieved. This can be fixed by adding a check like
[code2=java]if (highScore.contains(":"))[/code2]
So, you could combine them to prevent errors, like so:
[code2=java]if (highScore.contains(":"))
{
if (score > Integer.parseInt((highScore.split(":")[1])))
{
//do stuff here
}
}[/code2]
I hope that this helped!
[code2=java]if (score > Integer.parseInt((highScore.split(":")[1])))[/code2]
If this is so, then the problem is that the highScore variable does not actually contain a colon! So the data past the colon could not be retrieved. This can be fixed by adding a check like
[code2=java]if (highScore.contains(":"))[/code2]
So, you could combine them to prevent errors, like so:
[code2=java]if (highScore.contains(":"))
{
if (score > Integer.parseInt((highScore.split(":")[1])))
{
//do stuff here
}
}[/code2]
I hope that this helped!