I have a view (button) and am listening to a click event, but in my while loop it won't call the onClick
method:
public class Activity_Main extends Activity implements OnClickListener {
Button button1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
button1 = (Button)findViewById(R.id.btn_1);
button1.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_1:
//do something make boolean false for example
break;
}
}
while(boolean == true) {
//it's not reacting on the click
}
Is there something I am missing?