我想刷新imageview
从插座接收字节组。
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
while (!socket.isClosed()) {
imgArray = receiveImagebytes();
}
}
}).start();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while (!socket.isClosed()) {
runOnUiThread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
imageView.setImageBitmap(BitmapFactory.decodeByteArray(imgArray, 0, imgArray.length));
imageView.invalidate();
}
});
imgArray
是在另一个线程收到的ByteArray。 我想刷新它不working..It与相同的默认图标查看剩余的imageview..But