mcpixel
Newbie
I'm studying android and stumbled upon a problem! After reading this article in the section Worker Threads: https://developer.android.com/guide/components/processes-and-threads.html
My code
Now when I press a button, nothing happens even the text does not change and there are no mistakes. I don’t know what to do, help somebody!
My code
Java:
public void click(View view) {
new Thread(new Runnable() {
@Override
public void run() {
final TextView t = findViewById(R.id.textView);
t.setText("Wait...");
for(int i=0;i<999999;i++)
Log.e("test", ""+System.currentTimeMillis());
t.post(new Runnable() {
@Override
public void run() {
t.setText("Complete");
}
});
}
});
}