-2
当我在textview中执行setText时,它只显示数组的前三行,我需要一种方法来做result = result + xx.split(“\ n”);但在字符串数组中,这是不可能的,你可以教我另外一种方式来做到这一点吗?如何遍历字符串数组?
String xx="";
String result[] = {};
for(int i=0;i<row;i++) {
for(int c=0;c<col;c++) {
Cell z=s.getCell(c,i);
//Need an alternative to this because cannot do this in string array
result = result+ xx.split("\n");
}
}
textview.setText(resultado[0]+"--"+resultado[1]+"--"+resultado[2]);
'String xx'是空的吗?此外,遍历'result',将值添加到问题的'textView'中,而不是'result + =“something”;' –
为什么不将'split'存储在一个数组中,然后通过它进行交互? – Compass
字符串xx不是空的。你可以在下面举个例子吗? – jose