I have a thread where I will get some Bitmap
one by one. Then whenever I get a new Bitmap
I need to update my SurfaceView
which in the main thread. How can I do this?
Here is some pseudo code
new Thread() {
public void run() {
while (bitmapIncoming()) {
Bitmap bitmap = getNextBitmapAfterLongOperation();
mActivityReference.runOnUiThread(new Runnable() {
public void run() {
mActivityReference.updateSurfaceView(bitmap);
}
});
}
}
}.start();