public void populateLitterItem(String fieldValue, String otherFieldValue, String fieldType) { if (mLitter == null) { mLitter = new Litter(); setPassiveLitterInformation(); if (fieldType.equals("brand")) { mLitter.setBrand(fieldValue); mLitter.setOtherBrandName(otherFieldValue); checkForLitterType(); } if (fieldType.equals("type")) { mLitter.setLitterType(fieldValue); mLitter.setOtherLitterType(otherFieldValue); checkForLitterBrand(); } } else { if (fieldType.equals("brand")) { mLitter.setBrand(fieldValue); Log.d(TAG, "otherFieldBrand: " + otherFieldValue); mLitter.setOtherBrandName(otherFieldValue); } if (fieldType.equals("type")) { mLitter.setLitterType(fieldValue); mLitter.setOtherLitterType(otherFieldValue); } Log.d(TAG, "litter other brand: " + mLitter.getOtherBrandName()); logLitterItem(mLitter); } }
private void setPassiveLitterInformation() { try { mLitter.setUserEmail(mOutingManager.getGmailAccount()); mLitter.setCreated(new Date().getTime()); mLitter.setLatitude(mockLat); mLitter.setLongitude(mockLong); if (mOutingManager.getLocation() != null) { mLitter.setLatitude(mOutingManager.getLocation().getLatitude()); mLitter.setLongitude(mOutingManager.getLocation().getLongitude()); } mLitter.setEventId(mEventId); } catch (Exception e) { Log.w(TAG, e); } }