Wenn Sie einen Tisch zu machen versuchen:
int a[][] = new int[][]{{0,1,2,3,4},
{2,3,4,5,6},
{2,3,4,5,6}};
StringBuilder strBuild = new StringBuilder();
for(int i = 0; i < a[0].length; i++){
for(int j = 0; j < a.length; j++){
strBuild.append(a[i][j]);
strBuild.append(" ");
}
strBuild.append("\n");
}
yourTextVeiw.setText(strBuild.toString());
Wenn Sie versuchen, alle Zahlen in eine Zeile zu setzen:
Wenn Sie versuchen, sie alle in einer Spalte zu machen:
int a[][] = new int[][]{{0,1,2,3,4},
{2,3,4,5,6},
{2,3,4,5,6}};
StringBuilder strBuild = new StringBuilder();
for(int i = 0; i < a[0].length; i++){
for(int j = 0; j < a.length; j++){
strBuild.append(a[i][j]);
strBuild.append("\n");
}
}
yourTextView.setText(strBuild.toString());
und eine Reihe alle zertrümmert zusammen:
int a[][] = new int[][]{{0,1,2,3,4},
{2,3,4,5,6},
{2,3,4,5,6}};
StringBuilder strBuild = new StringBuilder();
for(int i = 0; i < a[0].length; i++){
for(int j = 0; j < a.length; j++){
strBuild.append(a[i][j]);
}
}
yourTextView.setText(strBuild.toString());
Ist es vollständige Code? Hast du Loops? Was ist "Tisch"? –
@SergeyGlotov 'TextView-Tabelle;' Keine Schleifen dort. –
@SergeyGlotov Array gefüllt mit "0" und "1". –