Android 如何从数组中选取第二个或第三个元素?

Android 如何从数组中选取第二个或第三个元素?,android,arrays,Android,Arrays,我有一个字符串[],里面有10个项目。每个项目都是edittext的文本。我使用Collections.shuffle(数组)对数组的值进行洗牌现在我需要打印文本视图中的第二项。我该怎么做呢?String[]items=新字符串[]{“a”,“b”}; String[] items = new String[]{"a","b"}; List<String> itemList = new ArrayList<>(Arrays.asList(items)); Collecti

我有一个
字符串[]
,里面有10个项目。每个项目都是edittext的文本。我使用
Collections.shuffle(数组)对数组的值进行洗牌
现在我需要打印文本视图中的第二项。我该怎么做呢?

String[]items=新字符串[]{“a”,“b”};
String[] items = new String[]{"a","b"};
List<String> itemList = new ArrayList<>(Arrays.asList(items));
Collections.shuffle(itemList);

TextView txtItem = findViewById(R.id.textView);
txtItem.set(itemList.get(1))
List itemList=newarraylist(Arrays.asList(items)); 集合。洗牌(项目列表); TextView txtItem=findViewById(R.id.TextView); txtItem.set(itemList.get(1))
由于
Collections.shuffle
receivelist是一个参数,所以应该将数组转换为List。 项[1]是从数组中拾取元素的重要部分。因为数字从0开始,所以第二个是1,第三个是2