//搜索按钮执行
public void onClick(View v) {
dismiss();
if (listener == null) {
return;
}
CheckBox cb = (CheckBox) layout.findViewById(R.id.searchcase);
boolean caseSense = cb.isChecked();
cb = (CheckBox) layout.findViewById(R.id.searchall);
boolean allMatch = cb.isChecked();
EditText edit = (EditText) layout.findViewById(R.id.searchedit);
String expr = edit.getText().toString();
listener.onSearch(expr, allMatch, caseSense);
}
});
btn = (Button) layout.findViewById(R.id.searchcancel);
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dismiss();
}
});
public void onClick(View v) {
dismiss(); 字面理解是打乱,打乱什么就不知道了
if (listener == null) {
return;
}
CheckBox cb = (CheckBox) layout.findViewById(R.id.searchcase);
boolean caseSense = cb.isChecked(); 是否区分大小写
cb = (CheckBox) layout.findViewById(R.id.searchall);
boolean allMatch = cb.isChecked(); 是否搜索全部
EditText edit = (EditText) layout.findViewById(R.id.searchedit);
String expr = edit.getText().toString(); 搜索什么
listener.onSearch(expr, allMatch, caseSense); 调用onSearch这个方法
}
});
btn = (Button) layout.findViewById(R.id.searchcancel); 取消按钮
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dismiss();
}
});
public void onClick(View v) {
dismiss();//你这应该是dialog,这是关闭
if (listener == null) {//是否设置了查询业务类吧,没设置返回。
return;
}
CheckBox cb = (CheckBox) layout.findViewById(R.id.searchcase);
boolean caseSense = cb.isChecked(); //多选框是否选中
cb = (CheckBox) layout.findViewById(R.id.searchall);
boolean allMatch = cb.isChecked(); //多选框是否选中
EditText edit = (EditText) layout.findViewById(R.id.searchedit);
String expr = edit.getText().toString(); //搜素的文本
listener.onSearch(expr, allMatch, caseSense); //查询
}
});
btn = (Button) layout.findViewById(R.id.searchcancel);
btn.setOnClickListener(new View.OnClickListener() {//设置button的click监听事件
public void onClick(View v) {
dismiss(); //点取消关闭dialog
}
});