コード例 #1
0
    @Override
    protected Boolean doInBackground(Void... urls) {

      if (autoOne != null && autoOne.length() != 0) {
        if (autoTwo != null && autoTwo.length() != 0) {
          if (autoThree != null && autoThree.length() != 0) {
            temp = RestApi.getInstance().findRecipeByIngredient(idOne, idTwo, idThree);

          } else {

            temp = RestApi.getInstance().findRecipeByIngredient(idOne, idTwo);
          }
        } else {
          if (idOne != -1) {
            temp = RestApi.getInstance().findRecipeByIngredient(idOne);
          }
        }
      } else {
        temp = RestApi.getInstance().getAllRecipes();
      }

      if (temp != null) {
        return true;
      }

      return false;
    }
コード例 #2
0
    @Override
    protected Boolean doInBackground(Void... urls) {
      ingredientsList = RestApi.getInstance().getAllIngredientType();

      if (ingredientsList != null) {
        result = new String[ingredientsList.size()];
        int i = 0;
        for (IngredientType c : ingredientsList) {
          result[i] = c.getName();
          i++;
        }
        return true;
      } else {
        result = null;
        return false;
      }
    }