我ProgressDialog
的没有显示。
这是代码:
et.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
performSearch();
return true;
}
return false;
}
private void performSearch() {
ProgressDialog pd = null;
pd = ProgressDialog.show(MainActivity.this, "Buscando...",
"Buscando " + et.getText() + " en GuiaColor");
lv.setAdapter(new SearchAdapter(MainActivity.this, handler
.search(et.getText().toString(), 20)));
pd.dismiss();
}
});
它工作得很好,唯一的问题是对话框没有出现。