Can anyone help me with only error which I got when I was converting switch to if-else statements?
This is code where on the default: Eclipse show me error with message "Syntax error on token "default", invalid Label"
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.btn_font_style) {
font.showDialog();
}
else if (id == R.id.btn_font_size) {
break;
fsize.show();
default: //I got error here
break;
}
}
This is my old code
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_font_style:
font.showDialog();
break;
case R.id.btn_font_size:
fsize.show();
default:
break;
}
}