All,
I have a problem related to imageView, android.
I have array which contains of 10 bitmap objects, called bm.
I have a imageView, called im.
Now I wanna show the bitmaps in the array in im one by one, so I did the following:
new Thread(new Runnable() {
public void run() {
for(int j=0;j<10;j++){
im.setImageBitmap(bm[j]);
}
}
}).start();
But the result only shows the last bitmap in the array.
Can someone tell me what to do with this issue?
Millions of thanks!
Don’t ever change a UI element in a thread. Most of the time this results in an exception. I don’t know why it didn’t here.
You’re blasting through all ten images in a mere milliseconds. That’s why the last one is the only one you see. You need to slow it down.
The easiest way would be the Handler/Runnable implementation like so: