在我的代码中,我使用异步任务加载微调器适配器在我的情况下,ProgressDialog 没有关闭这是我的代码。我想在适配器加载后显示项目,progressDialog 是关闭请帮助我,谢谢
private class LoadMoreVehicals extends AsyncTask<Object, Integer, Object> {
@Override
protected void onPreExecute() {
progressBar = ProgressDialog.show(RegistrationScreen.this, "",
"Loading...");
progressBar.setIndeterminate(true);
progressBar.setIndeterminateDrawable(getResources().getDrawable(
R.anim.progressbar_handler));
super.onPreExecute();
}
@Override
protected Object doInBackground(Object... params) {
String countryUrl = ConstantURL.COUNTRY_URL;
getCounty(countryUrl);
countrySpinner
.setAdapter(new MyCustomSpinnerAdapter(
RegistrationScreen.this,
R.layout.spinner_dropdown,
countyList));
return null;
}
@Override
protected void onProgressUpdate(Integer... values) {
progressBar.getProgress();
}
@Override
protected void onPostExecute(Object result) {
progressBar.dismiss();
Log.e("Im in onPostExecute", "");
super.onPostExecute(result);
}
}