What is the difference between true and false in this code?
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
int cbcheck = 1;
} else {
int cbcheck = 0;
}
}
@Override
public void onClick(View v) {
;
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.registerbut:
onCheckedChanged(cbagree, false);
if (cbcheck == 1) {
Intent intent = new Intent(this,
RegisterScreen2.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
} else if (cbcheck == 0){
}
break;
}
}
The part where it says onCheckedChanged(cbagree, true);
what would happen if I passed false instead?
I wish to make it so if the box is checked the intent will run, otherwise it'll state for you to check the box. I have tried saving the checkboxing and then loading it using savepreferences and loadpreferences but I find that is too much hassle. Is there any other way to accomplish this?
This is in android btw.