I did:
public static String textforspeech = "";
Then:
String a = null;
try
{
a = new String(checkServer, "UTF-8");
textforspeech = a;
if (textforspeech.equals("upload completed"))
MainActivity.this.initTTS();
if (textforspeech.equals("uploading"))
{
servercheckCounter += 1;
if (servercheckCounter == 1)
{
MainActivity.this.initTTS();
}
}
} catch (UnsupportedEncodingException e)
{
e.printStackTrace();
}
What i'm doing is:
if (textforspeech.equals("uploading"))
But now i changed it and textforspeech will contain:
uploading 345445
Then in a next update it will be:
uploading 345446
Then:
uploading 345447
Somehow i want to check if textforspeech contains "uploading" and if it does parse the number from the string. I know that if it does contains "uploading" it's also contain the number that will be update each time.
How do i check if it contains "uploading" and then how do i parse the number so in the end i will have two strings variables one contain all the time the "uploading" and one will contain the number "345445" then "uploading" and "345446" not a new string each time the number is updated just to parse the "uploading" and the number to two strings.