diff --git a/OsmAnd/src/net/osmand/AndroidNetworkUtils.java b/OsmAnd/src/net/osmand/AndroidNetworkUtils.java
index b14e8c56a8..85feae4ca8 100644
--- a/OsmAnd/src/net/osmand/AndroidNetworkUtils.java
+++ b/OsmAnd/src/net/osmand/AndroidNetworkUtils.java
@@ -66,7 +66,7 @@ public class AndroidNetworkUtils {
}
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
index 96674888da..5736d71f13 100644
--- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
+++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
@@ -970,7 +970,7 @@ public class OsmandAidlApi {
}
}
- }.execute(destination);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, destination);
} else {
helper.selectGpxFile(selectedGpx.getGpxFile(), false, false);
refreshMap();
@@ -991,7 +991,7 @@ public class OsmandAidlApi {
}
}
- }.execute(destination);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, destination);
}
}
@@ -1098,7 +1098,7 @@ public class OsmandAidlApi {
}
}
- }.execute(f);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, f);
return true;
}
diff --git a/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java b/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java
index a811f068ec..2a4c25b645 100644
--- a/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java
+++ b/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java
@@ -99,7 +99,7 @@ public class CurrentPositionHelper {
}
return null;
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
res = true;
}
return res;
diff --git a/OsmAnd/src/net/osmand/plus/GeocodingLookupService.java b/OsmAnd/src/net/osmand/plus/GeocodingLookupService.java
index 66ea3c28b7..203d2c6e34 100644
--- a/OsmAnd/src/net/osmand/plus/GeocodingLookupService.java
+++ b/OsmAnd/src/net/osmand/plus/GeocodingLookupService.java
@@ -117,11 +117,7 @@ public class GeocodingLookupService {
@SuppressWarnings("unchecked")
private
void execute(AsyncTask
task, P... requests) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, requests);
- } else {
- task.execute(requests);
- }
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, requests);
}
private boolean geocode(final LatLon latLon) {
diff --git a/OsmAnd/src/net/osmand/plus/OsmAndTaskManager.java b/OsmAnd/src/net/osmand/plus/OsmAndTaskManager.java
index 16e8b78ce6..31a5d889e6 100644
--- a/OsmAnd/src/net/osmand/plus/OsmAndTaskManager.java
+++ b/OsmAnd/src/net/osmand/plus/OsmAndTaskManager.java
@@ -16,7 +16,7 @@ public class OsmAndTaskManager {
OsmAndTaskRunnable r, Params... params) {
InternalTaskExecutor exec = new InternalTaskExecutor(r);
r.exec = exec;
- exec.execute(params);
+ exec.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
return exec;
}
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index e78ad9ab4d..47330d8464 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -201,7 +201,7 @@ public class OsmandApplication extends MultiDexApplication {
protected void onPostExecute(Void result) {
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public IconsCache getIconsCache() {
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
index 27538c97d0..461f6ff0e6 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
@@ -135,7 +135,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
return null;
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
@@ -599,7 +599,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
}
};
- exportTask.execute();
+ exportTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
protected void export() {
@@ -639,14 +639,14 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- exportTask.execute();
+ exportTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
bld.setNegativeButton(R.string.shared_string_no, null);
bld.setMessage(R.string.fav_export_confirmation);
bld.show();
} else {
- exportTask.execute();
+ exportTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java
index 2c4fecbd10..9b95a3e3a5 100644
--- a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java
@@ -182,7 +182,7 @@ public class IntermediatePointsDialog {
originalPositions.addAll(newOriginalPositions);
listadapter.notifyDataSetChanged();
};
- }.execute(new Void[0]);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, new Void[0]);
}
});
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 59c85b86a2..7bc3921d6e 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -1234,7 +1234,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
protected void onPostExecute(Void result) {
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index 0df03f40e1..d64b109c55 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -222,7 +222,7 @@ public class MapActivityActions implements DialogProvider {
dlg.findViewById(R.id.DuplicateFileName).setVisibility(View.VISIBLE);
} else {
dlg.dismiss();
- new SaveDirectionsAsyncTask(app).execute(toSave);
+ new SaveDirectionsAsyncTask(app).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, toSave);
}
}
});
diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
index 43e5f25d1d..3ccdba5893 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
@@ -588,7 +588,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
updateSettingsToNewDir(path.getParentFile().getAbsolutePath());
}
});
- task.execute();
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
builder.setNeutralButton(R.string.shared_string_no, new OnClickListener() {
@@ -630,7 +630,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
setProgressVisibility(false);
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
public void loadNativeLibrary() {
@@ -656,7 +656,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
Toast.makeText(SettingsGeneralActivity.this, R.string.native_library_not_supported, Toast.LENGTH_LONG).show();
}
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java b/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java
index 0cd778acb5..b4309e66e7 100644
--- a/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/TrackActivity.java
@@ -309,7 +309,7 @@ public class TrackActivity extends TabActivity {
}
}
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java
index 7ffeae8397..71dc479bc8 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/GeoIntentActivity.java
@@ -63,7 +63,7 @@ public class GeoIntentActivity extends OsmandListActivity {
});
progress.setCancelable(true);
- task.execute();
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
setIntent(null);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java
index b07fe9b5bb..dba413e100 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineFragment.java
@@ -223,7 +223,7 @@ public class SearchAddressOnlineFragment extends Fragment implements SearchActiv
adapter.setPlaces(places);
}
};
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java
index 64a36d42f2..f359311486 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java
@@ -177,7 +177,7 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity
selectAddress = getIntent() != null && getIntent().hasExtra(SELECT_ADDRESS);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
if (initializeTask != null){
- initializeTask.execute();
+ initializeTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java
index a1c1964563..ad106c37e8 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java
@@ -475,7 +475,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
private synchronized void runNewSearchQuery(net.osmand.Location location, int requestType) {
if (currentSearchTask == null || currentSearchTask.getStatus() == Status.FINISHED) {
currentSearchTask = new SearchAmenityTask(location, requestType);
- currentSearchTask.execute();
+ currentSearchTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java
index f80cf45db3..cc55f1a2f5 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java
@@ -107,7 +107,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
currentTask.cancel(true);
}
currentTask = new SearchPoiByNameTask();
- currentTask.execute(s.toString().trim());
+ currentTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, s.toString().trim());
}
});
searchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
diff --git a/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java b/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java
index 02c2c3ddec..6d0c671422 100644
--- a/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java
+++ b/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java
@@ -149,7 +149,7 @@ public class FailSafeFuntions {
};
- task.execute(gpxPath);
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, gpxPath);
}
};
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashChooseAppDirFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashChooseAppDirFragment.java
index 173f4701c4..faed84088e 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashChooseAppDirFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashChooseAppDirFragment.java
@@ -336,7 +336,7 @@ public class DashChooseAppDirFragment {
updateView();
}
};
- task.execute();
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
confirmBtn.setOnClickListener(getConfirmListener());
@@ -375,7 +375,7 @@ public class DashChooseAppDirFragment {
protected void successCallback() {}
protected void reloadData() {
- new ReloadData(activity, getMyApplication()).execute((Void) null);
+ new ReloadData(activity, getMyApplication()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
public OsmandApplication getMyApplication() {
diff --git a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java
index 75720cc882..487e2a22ac 100644
--- a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java
@@ -384,7 +384,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
}
};
};
- exportTask.execute();
+ exportTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void startEditingHelp(MapActivity ctx) {
final CommonPreference pref = app.getSettings().registerBooleanPreference("show_measurement_help_first_time", true);
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
index 55ff51d757..c11773f884 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
@@ -784,7 +784,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
newDownloadIndexes();
}
};
- task.execute();
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
index ebed865817..ab8ddadf54 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
@@ -322,11 +322,7 @@ public class DownloadIndexesThread {
@SuppressWarnings("unchecked")
private void execute(BasicProgressAsyncTask, P, ?, ?> task, P... indexItems) {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, indexItems);
- } else {
- task.execute(indexItems);
- }
+ task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, indexItems);
}
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java
index a159d4bb6f..7a8ea7531d 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java
@@ -2,6 +2,7 @@ package net.osmand.plus.download.ui;
import android.app.Activity;
import android.content.DialogInterface;
+import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.StatFs;
@@ -259,7 +260,7 @@ public class DataStoragePlaceDialogFragment extends BottomSheetDialogFragment {
}
private void reloadData() {
- new DashChooseAppDirFragment.ReloadData(getActivity(), getMyApplication()).execute((Void) null);
+ new DashChooseAppDirFragment.ReloadData(getActivity(), getMyApplication()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
public static void showInstance(FragmentManager fragmentManager, boolean storageReadOnly) {
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java
index 6ae4e7b33c..acafce29f7 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/DownloadResourceGroupFragment.java
@@ -325,7 +325,7 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
}
}
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java
index c8853a782d..ab9dc902d1 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java
@@ -6,6 +6,7 @@ import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
+import android.os.AsyncTask;
import android.support.v4.view.ViewCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
@@ -416,7 +417,7 @@ public class ItemViewHolder {
@Override
public void onClick(DialogInterface dialog, int which) {
new LocalIndexOperationTask(context, null, LocalIndexOperationTask.DELETE_OPERATION)
- .execute(info);
+ .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info);
}
});
confirm.setNegativeButton(R.string.shared_string_no, null);
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java
index 076e6a4c7e..577fa38c67 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/LocalIndexesFragment.java
@@ -149,7 +149,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
if (current == null || current.getStatus() == AsyncTask.Status.FINISHED ||
current.isCancelled() || current.getResult() != null) {
asyncLoader = new LoadLocalIndexTask();
- asyncLoader.execute();
+ asyncLoader.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
@@ -224,7 +224,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.CLEAR_TILES_OPERATION).execute(info);
+ new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.CLEAR_TILES_OPERATION).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info);
}
});
confirm.setNegativeButton(R.string.shared_string_no, null);
@@ -234,13 +234,13 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
confirm.setMessage(getString(R.string.delete_confirmation_msg, fn));
confirm.show();
} else if (resId == R.string.local_index_mi_restore) {
- new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.RESTORE_OPERATION).execute(info);
+ new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.RESTORE_OPERATION).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info);
} else if (resId == R.string.shared_string_delete) {
AlertDialog.Builder confirm = new AlertDialog.Builder(getActivity());
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.DELETE_OPERATION).execute(info);
+ new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.DELETE_OPERATION).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info);
}
});
confirm.setNegativeButton(R.string.shared_string_no, null);
@@ -250,7 +250,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
confirm.setMessage(getString(R.string.delete_confirmation_msg, fn));
confirm.show();
} else if (resId == R.string.local_index_mi_backup) {
- new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.BACKUP_OPERATION).execute(info);
+ new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.BACKUP_OPERATION).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, info);
}
return true;
}
@@ -699,7 +699,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
operationTask = null;
}
if (operationTask != null) {
- operationTask.execute(selectedItems.toArray(new LocalIndexInfo[selectedItems.size()]));
+ operationTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, selectedItems.toArray(new LocalIndexInfo[selectedItems.size()]));
}
if (actionMode != null) {
actionMode.finish();
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java
index ba8eaa4f7d..44254053bb 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/SearchDialogFragment.java
@@ -349,7 +349,7 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
CityItem item = (CityItem) obj;
viewHolder.bindIndexItem(item);
if (item.getIndexItem() == null) {
- new IndexItemResolverTask(viewHolder, item).execute();
+ new IndexItemResolverTask(viewHolder, item).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
} else {
diff --git a/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java b/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java
index b33f33311c..b7f5f59f63 100644
--- a/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java
+++ b/OsmAnd/src/net/osmand/plus/firstusage/FirstUsageWizardFragment.java
@@ -376,7 +376,7 @@ public class FirstUsageWizardFragment extends Fragment implements OsmAndLocation
showNoLocationFragment(getActivity());
}
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
FragmentActivity activity = getActivity();
diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java
index c8abbd7808..f8037fa806 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java
@@ -86,7 +86,7 @@ public class DiscountHelper {
processDiscountResponse(response, mapActivity);
}
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
@SuppressLint("SimpleDateFormat")
diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java
index f74a874db7..4e2dace70c 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/GpxImportHelper.java
@@ -173,7 +173,7 @@ public class GpxImportHelper {
progress.dismiss();
handleResult(result, fileName, save, useImportDir, false);
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void handleFavouritesImport(final Uri gpxFile, final String fileName, final boolean save, final boolean useImportDir, final boolean forceImportFavourites) {
@@ -211,7 +211,7 @@ public class GpxImportHelper {
progress.dismiss();
importFavourites(result, fileName, save, useImportDir, forceImportFavourites);
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void importFavoritesImpl(final GPXFile gpxFile, final String fileName, final boolean forceImportFavourites) {
@@ -245,7 +245,7 @@ public class GpxImportHelper {
newIntent.putExtra(FavoritesActivity.OPEN_FAVOURITES_TAB, true);
activity.startActivity(newIntent);
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void handleKmzImport(final Uri kmzFile, final String name, final boolean save, final boolean useImportDir) {
@@ -298,7 +298,7 @@ public class GpxImportHelper {
handleResult(result, name, save, useImportDir, false);
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void handleKmlImport(final Uri kmlFile, final String name, final boolean save, final boolean useImportDir) {
@@ -342,7 +342,7 @@ public class GpxImportHelper {
progress.dismiss();
handleResult(result, name, save, useImportDir, false);
}
- }.execute();
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
private void handleResult(final GPXFile result, final String name, final boolean save,
@@ -355,7 +355,7 @@ public class GpxImportHelper {
}
} else {
if (save) {
- new SaveAsyncTask(result, name, useImportDir).execute();
+ new SaveAsyncTask(result, name, useImportDir).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
showGpxOnMap(result);
}
diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
index b336819d22..59e29dc5dc 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
@@ -794,7 +794,7 @@ public class WaypointDialogHelper {
reloadListAdapter(listAdapter);
}
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
public AdapterView.OnItemClickListener getDrawerItemClickListener(final FragmentActivity ctx, final int[] running,
@@ -861,7 +861,7 @@ public class WaypointDialogHelper {
reloadListAdapter(listAdapter);
}
}
- }.execute((Void) null);
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void) null);
}
public void reloadListAdapter(ArrayAdapter