朋友们,
我在 asyncTask 中使用以下代码
公共类 AsycLoaderFromDbAndMapInjector 扩展 AsyncTask {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Boolean doInBackground(Void... arg0) {
Log.d("Asynctask", ""+arg0);
boolean show = false;
if(db == null)
db = new dbHelper(me);
ATM results = null;
try {
results = db.getAtmsBySelectedBanks(atm.getSelectedBankList(), selectedCity);
if (results != null) {
LoopThroughEachATMToDisplayOnMap();
}
return show;
}
@Override
protected void onPostExecute(Boolean result) {
stopProgress();
}
私人无效 LoopThroughEachATMToDisplayOnMap() {
Drawable drawable = getResources().getDrawable(
R.drawable.marker);
itemizedOverlay = new MyItemizedOverlay(drawable, mapView);
for (int i = 0; i < atm.getAtmList().size(); i++) {
ATM a = atm.getAtmList().get(i);
if (a != null) {
int[] coordinates = getIntCoordinates(a
.getCoordinates());
if (coordinates != null) {
GeoPoint point = new GeoPoint(coordinates[0],
coordinates[1]);
OverlayItem overlayItem = new OverlayItem(
point, a.getBankName(), a.getAddress()
+ "@@" + a.getPhone() + "@@"
+ a.getWebAddress() + "@@"
+ a.getCoordinates());
itemizedOverlay.addOverlay(overlayItem);
System.out
.println("coordinates-------------------------"
+ i + " "
+ coordinates[0]
+ ","
+ coordinates[1]);
}
}
}
}
}
现在当我按下后退按钮时,这个可运行的填充继续在我使用过的后端运行
AsyncTask.cancel() on backbuttonpressed 事件,但它仍然继续运行任何人指导我如何解决这个问题?