@Override public void onPause() { super.onPause(); mapOverlays.clear(); // shut down background thread _asyncTask.cancel(true); }
@Override public void onResume() { super.onResume(); HeatMapSvc.Instance().Reset(); // TODO - get rid of state info in service ugh _totalNumMoods = 1; _totalNumMoodsFetched = 0; moodPointList.clear(); // spin up a background thread to get the moods // this could take some time so inform the user what's up periodically _asyncTask = new GetMoodsFromServiceTask(); _asyncTask.execute(1, 2, null); Toast toast = Toast.makeText(this, "Downloading moods ...", Toast.LENGTH_LONG); toast.show(); }