2 回答

TA貢獻(xiàn)1853條經(jīng)驗(yàn) 獲得超6個(gè)贊
僅當(dāng)圖像要顯示時(shí)才需要發(fā)布處理程序。只需更改您的代碼,例如,
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);
}
}
};
添加回答
舉報(bào)