How can I put my result array values into the text box "Test TextView" here?
I'm sosososo new to JAVA, so it would be really appreciated if you explain me too. Looking forward to get a nice answer!
public static void main(String args[]) {
ArrayList<Integer> lottoNum = new ArrayList<Integer>();
for (int i=1; i<=45; i++) {
lottoNum.add(i);
}
Collections.shuffle(lottoNum);
int[] lottoNums = new int[6];
for (int i = 0; i <6; i++){
lottoNums[i] = lottoNum.get(i);
String s = java.util.Arrays.toString(lottoNums);
}
}
I want to put the result of "lottoNums"
for example something like [11 28 55 32 66 77]
into the text box below.
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
TextView textView = findViewById(R.id.text_view);
// テキストを設定して表示
textView.setText("Test TextView");
This textView.setText() here.