Error only when i use editText.setText(sbz); What to do? Without Thread, setText works good
public void onstart(View view) {
setContentView(R.layout.activity_main);
EditText editText = (EditText)findViewById(R.id.result);
Toast.makeText(this, "LOG FINISH!", Toast.LENGTH_SHORT).show();
String str = new String((String) textView1.getText());
StringBuilder sbz = new StringBuilder();
new Thread(() -> {
int x = 0;
while(x<100) {
x++;
sbz.append(str);
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
editText.setText(sbz);
}).start();