How can we mult-thread in libgdx ?
I tried:
new Thread(new Runnable() {
@Override
public void run() {
// do something important here, asynchronously to the rendering thread
final int result = 10;
// post a Runnable to the rendering thread that processes the result
Gdx.app.postRunnable(new Runnable() {
@Override
public void run() {
Array<Integer> results = new Array<Integer>;
Gdx.app.log("Thread1", "Worked");
results.add(result);
}
});
}
}).start();
I have read here and it is official. But it did not tell me specifically how to access the array.
How can I access the result? through postRunnable