0
我正在嘗試編寫幻燈片放映的程序。到目前爲止,我無法弄清楚如何在圖像之間切換。每次我寫一個循環時,唯一顯示的圖像就是最後一個。我在做什麼錯誤 P.S.我知道它不好的代碼,我玩弄它,因爲我是新來的影像爲Android幻燈片切換的圖像
int currentInt;
int imgid[] = { R.drawable.better, R.drawable.beyond_innovation,
R.drawable.innovation, R.drawable.jobs, R.drawable.no_limits,
R.drawable.praxis_name, R.drawable.reinvent,
R.drawable.single_source, R.drawable.toys_to_rockets,
R.drawable.design };
RefreshHandler refreshHandler = new RefreshHandler();
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.slideshow);
this.txtStatus = (TextView) this.findViewById(R.id.pic_view1);
this.imageView = (ImageView) this.findViewById(R.id.slides);
for (int i = 1; i < 100000; i++) {
imageView.setImageResource(imgid[0]);
}
for (int i = 1; i < 100000; i++) {
imageView.setImageResource(imgid[1]);
}