だから最終的に私は私
public class MainActivity extends AppCompatActivity {
volatile boolean toExit = false;
Thread t;
private int i = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
t = new Thread(new Runnable() {
@Override
public void run() {
if (toExit = true) {
for (i = i; i <= 10; i++) {
Log.w("Number i ", "is --->" + i);
i = i + 1;
break;
}
} else {
toExit = false;
}
}
});
findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
t.start();
Log.w("Thread ", "Start!!!");
}
});
}
}
のために働いて解決策を考え出しました