private void updateTipFromArray(Tip tip, Group<Tip> target) { for (Tip it : target) { if (it.getId().equals(tip.getId())) { it.setStatus(tip.getStatus()); break; } } }
@Override public void onPostExecute(Tip tip) { if (DEBUG) Log.d(TAG, "TipAddTask: onPostExecute()"); try { if (tip == null) { NotificationsUtil.ToastReasonForFailure(VenueActivity.this, mReason); } else { String tipToastString = "Added Tip #" + tip.getId() + " " + tip.getText(); // Refresh the tips list. Toast.makeText(VenueActivity.this, tipToastString, Toast.LENGTH_LONG).show(); new VenueTask().execute(mStateHolder.venueId); } } finally { stopProgressBar(PROGRESS_BAR_TASK_ID); mStateHolder.tip = null; } }