Possible Duplicate:
Is there a goto statement in java?
In my android application i used goto statement to control the flow. But I received error as "Syntax error on token goto, throw expected". Here is my code
label:
if(alc)
{
r_code=st.nextToken();
AlertDialog.Builder alert=new AlertDialog.Builder(Fetch.this);
alert.setTitle(count+" records found for "+rytname.getText().toString());
alert.setMessage("Are you sure want to search for "+r_code+"?");
alert.setPositiveButton("YES", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ff=1;
alc=false;
}
});
alert.setNegativeButton("NO", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
ff=0;
}
});
alert.show();
if (ff==0)
{
goto label;
}
I'm new to this android, and help me to avoid this error