即时通讯新手android.For显示随机图像我用arraylist。显示随机图像
ArrayList<Integer> List = new ArrayList<Integer>();
for(int i=0;i<10;i++)
{
List.add(i);
System.out.println("Random Images"+List.add(i));
}
Collections.shuffle(List);
for(int i=0;i<10;i++){
imageArr[i] = (ImageView)findViewById(id[List.get(i)]);
System.out.println("Display Images"+List.get(i));
}
}
它在logcat中正确运行,但应该怎么做才能在模拟器屏幕上显示图像。请推荐
你想到的是,仿真器正确解释你的Sysouts? – RoflcoptrException
你在Logcat中看到的是你正在洗牌ArrayList,它与图像本身无关。 –
是的,即使在logcat.Logcat中得到正确的结果是:08-23 15:53:07.053:INFO/System.out(453):Random Imagestrue 08-23 15:53:07.053:INFO/System.out(453 ):Random Imagestrue 08-23 15:53:07.053:INFO/System.out(453):Display Images6 08-23 15:53:07.060:INFO/System.out(453):Display Images1 08-23 15:53:07.103:INFO/System.out(453):Random Imagestrue 08-23 15:53:07.103:INFO/System.out(453):Random Imagestrue 08-23 15:53:07.180:INFO/System.out(453):Display Images5 08-23 15:53:07.180:INFO/System.out(453):Display Images0 – Sam