Since you are running a different thread, you cannot expect the code to execute sequentially like:
Thread mythread = new Thread(runnable);
mythread.start();
textinfo += Global.classtext;
textinfo += "Finished.\n";
tv.setText(textinfo);
return true;
By the time the main thread hits return true, Global.classtext
may have not been changed by the parallel thread yet
To see what I mean, try changing your code to this:
Thread mythread = new Thread(runnable);
mythread.start();
while(mythread.isAlive()){
//wait till thread finishes
}
textinfo += Global.classtext;
textinfo += "Finished.\n";
tv.setText(textinfo);
return true;