我這是爲了我的滾動圖片視圖,使其落在每0.1秒5個像素的功能,但是當我運行這個功能我得到Sorry Application has stopped responding
Java Android - ImageView滾動導致崩潰?
你可以看看下面我的代碼:
void startGameLoop(){
boolean alive=true;
while(alive){
int x = theSprite.getScrollX();
int y = theSprite.getScrollY();
y-=5;
theSprite.scrollTo(x, y);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
對此的任何幫助將不勝感激。
請添加logcat!到目前爲止,我看起來像是一個永恆的循環。我的意思是什麼時候會'活着==假' – donfuxx