2 回答

TA貢獻1853條經驗 獲得超6個贊
僅當圖像要顯示時才需要發布處理程序。只需更改您的代碼,例如,
Handler handler = new Handler();
Runnable runnable = new Runnable() {
int i = 0;
ImageView splashImageView;
public void run() {
splashImageView.setImageResource(imageArraySplashScreen[i]);
i++;
if (i > imageArraySplashScreen.length - 1) {
i = 0;
Intent splashScreenIntent = new Intent(SplashScreen.this, MainActivity.class);
startActivity(splashScreenIntent);
finish();
} else {
handler.postDelayed(this, 2000);
}
}
};
添加回答
舉報