Java 如何使用android studio在直接屏幕上填充数组,以便可以从控制台打印
我想要一个解决方案,取代控制台,并显示在屏幕上的权利,或使用一些工具,如警报或什么,这是可能的结果Java 如何使用android studio在直接屏幕上填充数组,以便可以从控制台打印,java,android-studio,Java,Android Studio,我想要一个解决方案,取代控制台,并显示在屏幕上的权利,或使用一些工具,如警报或什么,这是可能的结果 for (int x = 0; x < classe; x++) { for (int c = 0; c < 4; c++) { System.out.print(tab[x][c] + " | "); } System.out.println(); } }
for (int x = 0; x < classe; x++) {
for (int c = 0; c < 4; c++) {
System.out.print(tab[x][c] + " | ");
}
System.out.println();
}
}
for(int x=0;x
您可以使用类似于Toast
或Snackbar
的东西
String string = "";
for (int x = 0; x < classe; x++) {
for (int c = 0; c < 4; c++) {
string += tab[x][c] + " | ";
}
string += "\n";
}
}
// toast example
Toast.makeText(activity, string, Toast.LENGTH_LONG);
// snackbar example
Snackbar.make(activity.findViewById(android.R.id.content), string, Snackbar.LENGTH_LONG).show();
String=”“;
对于(int x=0;x
查看更多信息