Previous I haved that AsyncTask on main activity and called with:
new SyncGetLocations(ActivityMain.this).execute();
Now,I move it to a fragment and don't know now how to call it from MainActivity
.
AsyncTask look alike :
private static class SyncGetLocations extends AsyncTask<Void, Void, Void> {
private WeakReference<ActivityMap> activityReference;
SyncGetLocations(ActivityMap context) {
activityReference = new WeakReference<>(context);
}
@Override
protected void onPreExecute() {
}
@Override
protected Void doInBackground(Void... voids) {
}
@Override
protected void onPostExecute(Void aVoid) {
}
}