@Override public void addInfo(String serverResponse) { try { JSONObject jObj = new JSONObject(serverResponse); JSONArray jArr = jObj.getJSONArray(RESPONSE_TEXT_CORECT_ID); if (jArr.length() > 0) { JSONObject obj = jArr.getJSONObject(0); selectedBean = new ContactoDetalle(obj); showValues(selectedBean); } } catch (Exception e) { Message.showShortExt(Utils.errorToString(e), getApplicationContext()); } }
@Override public void onClick(View v) { boolean continueModule = true; ActivityBeanCommunicator communicator = new ActivityBeanCommunicator(selectedBean.getId(), selectedBean.getFirst_name()); if (selectedBean.getIdAccount() == null) { Message.showShortExt("Este Contacto no Tiene Cuentas Asociadas", this); return; } Modules module = null; if (v.getId() == imageButtonAccounts.getId()) { ActivitiesMediator.getInstance() .showActivity( ContactActivity.this, Modules.ACCOUNTS, new ActivityBeanCommunicator(selectedBean.getIdAccount(), "")); return; } else if (v.getId() == imageButtonOpps.getId()) { module = Modules.OPPORTUNITIES; } else if (v.getId() == imageButtonTasks.getId()) { module = Modules.TASKS; } else if (v.getId() == imageButtonCalls.getId()) { module = Modules.CALLS; } else if (v.getId() == btnMakeCall.getId()) { continueModule = false; communicator.setAction(ActionActivity.MAKE_CALL); communicator.setAdditionalInfo(this.getPhoneNumer()); ActivitiesMediator.getInstance().setActualID(communicator, MODULE); ActivitiesMediator.getInstance().showEditActivity(this, Modules.CALLS, false); } if (continueModule) { ActivitiesMediator.getInstance() .setActualID( new ActivityBeanCommunicator(selectedBean.getIdAccount(), ""), Modules.ACCOUNTS); ActivitiesMediator.getInstance().setActualID(communicator, MODULE); ActivitiesMediator.getInstance().showList(ContactActivity.this, module, MODULE); } }