Android--获得0-n随机排列的数组 (2012-11-20 20:15:32) 转载▼ 标签: it 分类: Android public static Integer[] getRandomId(int n) { Integer[] arryRandom = new Integer[n]; for (int i = 0; i < n; i++) arryRandom[i] = i; List list = Arrays.asList(arryRandom); Collections.shuffle(list); return arryRandom; }