我的应用程序在键盘妨碍的对话框中有一系列 TextView。我正在尝试使用以下代码来使用事件使键盘消失。它不会编译,因为它说'void 是变量构建器的无效类型'!
@Override
protected Dialog onCreateDialog(int id) {
LayoutInflater layoutInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View layout = layoutInflater.inflate(R.layout.exindex_dialog, (ViewGroup) findViewById(R.id.ex_index));
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(layout);
builder.setOnItemSelectedListener((OnItemSelectedListener) arg0);
{
public void builder.filterStr2.isSelected(); //error is here
{
InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
mgr.hideSoftInputFromWindow(filterStr2.getWindowToken(), 0);
}
}
}
我究竟做错了什么?