package com.rehivetech.beeeon.threading.task;

import android.content.Context;

import com.rehivetech.beeeon.controller.Controller;

import java.util.EnumSet;

/**
 * Created by martin on 29.3.16.
 */
public class ReloadDashboardDataTask extends ReloadGateDataTask{


	public ReloadDashboardDataTask(Context context, boolean forceReload, ReloadWhat what) {
		super(context, forceReload, what);
	}

	public ReloadDashboardDataTask(Context context, boolean forceReload, EnumSet<ReloadWhat> what) {
		super(context, forceReload, what);
	}


	@Override
	public Boolean doInBackground(String... params) {
		if (!super.doInBackground(params[0])) {
			return false;
		}

		if (params.length ==  1) {
			return true;
		}

		return Controller.getInstance(mContext).getWeatherModel().reloadWeather(mContext, params[0], params[1], params[2]);
	}
}

@@ -124,16 +124,69 @@
 troller;
+%0Aimport com.rehivetech.beeeon.exception.AppException;
 %0A%0Aimport
@@ -646,16 +646,25 @@
 rams) %7B%0A
+%09%09try %7B%0A%09
 %09%09if (!s
@@ -693,24 +693,76 @@
 rams%5B0%5D)) %7B%0A
+%09%09%09%09return false;%0A%09%09%09%7D%0A%09%09%7D catch (AppException e) %7B%0A
 %09%09%09return fa
@@ -793,17 +793,16 @@
 ength ==
- 
  1) %7B%0A%09%09

Fix crash in reload task in dashboard