이것은 내 코드이므로 임의 값 (0에서 1 사이)을 인쇄해야하지만 그렇게하지는 않습니다!TextView에 텍스트가 표시되지 않습니다.
나는 그것을 고치는 법을 모른다. 나는 여러 가지를 시도했다, 그들 중의 누구도 일하고 있지 않다!
package com.example.lode.coder;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.TextView;
import java.util.Random;
public class Coder extends AppCompatActivity {
TextView display;
String one;
boolean bl= true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_coder);
display = (TextView) findViewById(R.id.text);
}
void all() {
while (bl) {
Random rand = new Random();
int n = rand.nextInt(2);
one = n + (String) display.getText();
display.setText(one);
}
}
}
어디에서 all() 메서드를 호출합니까? –