COnsider this following code:
Button add_product_button = (Button) findViewById(R.id.add_product_button);
add_product_button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Before going further, we check whether all the information is provided or not
EditText item_title_text = (EditText) findViewById(R.id.item_title);
if(isEmpty(item_title_text)){
break;
}
I want the 'break;' to be the response that I would not want to proceed further (not executing the rest code and just get out).
This is to alarm user that insufficient information has been provided. How can I achieve this?