public static DeckTask launchDeckTask(int type, TaskListener listener, TaskData... params) { oldInstance = instance; instance = new DeckTask(); instance.listener = listener; instance.type = type; return (DeckTask) instance.execute(params); }
public static DeckTask launchDeckTask(int type, TaskListener listener, TaskData... params) { try { if ((instance != null) && (instance.getStatus() != AsyncTask.Status.FINISHED)) instance.get(); } catch (Exception e) { e.printStackTrace(); } instance = new DeckTask(); instance.listener = listener; instance.type = type; return (DeckTask) instance.execute(params); }