// process current active action public void performAction(Action.Type currentActionType, String result) { switch (currentActionType) { case LOG_LITTER_TYPE: populateLitterItem(yesNoSearch.getPotentialField(), null, "type"); break; case LOG_OTHER_LITTER_TYPE: populateLitterItem("other", yesNoSearch.getPotentialOtherField(), "type"); break; case LOG_LITTER_BRAND: populateLitterItem(yesNoSearch.getPotentialField(), null, "brand"); break; case LOG_OTHER_BRAND: Log.d(TAG, "Logging other brand"); populateLitterItem("other", yesNoSearch.getPotentialOtherField(), "brand"); break; case LOG_BIN_ITEM: populateBinItem(yesNoSearch.getPotentialField(), null); logBin(mBin); setCurrentSearch(brandSearch, result); break; case LOG_OTHER_BIN_TYPE: populateBinItem("other", yesNoSearch.getPotentialOtherField()); break; case LITTER_BRAND_SEARCH: setCurrentSearch(brandSearch, result); break; case LITTER_TYPE_SEARCH: setCurrentSearch(typeSearch, result); break; case BIN_SEARCH: setCurrentSearch(binSearch, result); break; case MENU_SEARCH: setCurrentSearch(menuSearch, result); break; default: Log.d(TAG, "invalid action type"); } mActionHandler.setActionPerformed(true); Log.d(TAG, "action performed"); Toast.makeText(mContext, "action performed", Toast.LENGTH_SHORT).show(); }