My ProgressDialog is not showing.
Here’s the code:
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();
}
});
It works just fine, the only issue is that the Dialog does not show up.
Try the following code to make your query in a background thread and dismiss your dialog once the task is completed: