【发布时间】:2016-07-04 15:38:36
【问题描述】:
考虑以下代码:
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;
}
我想要'休息;'成为我不想继续进行的响应(不执行其余代码并退出)。
这是为了提醒用户提供的信息不足。我怎样才能做到这一点?
【问题讨论】: