@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; } }
public void attemptSearch() { category = spinner.getSelectedItem().toString(); title = searchtitle.getText().toString(); autoOne = autoComplete1.getText().toString(); autoTwo = autoComplete2.getText().toString(); autoThree = autoComplete3.getText().toString(); time = seekbar.getProgress(); for (IngredientType i : ingredientsList) { if (i.getName().equals(autoOne)) { idOne = i.getID(); } if (i.getName().equals(autoTwo)) { idTwo = i.getID(); } if (i.getName().equals(autoThree)) { idThree = i.getID(); } } mSearchStatusMessageView.setText(R.string.search_progress_signing_in); showProgress(true); mUserRecipesSearch = new UserRecipesSearch(); mUserRecipesSearch.execute(); }