Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void enviarVoucher() {
- try {
- JSONObject jsonObject = new JSONObject();
- // jsonObject.put("numeroComprobante", etNumeroComprobante.getText().toString().trim());
- jsonObject.put("cliente1", etNombreCliente1.getText().toString().trim());
- jsonObject.put("cliente2", etNombreCliente2.getText().toString().trim());
- // jsonObject.put("cliente3", etNombreCliente3.getText().toString().trim());
- // jsonObject.put("cliente4", etNombreCliente4.getText().toString().trim());
- jsonObject.put("destinos", etDestinos.getText().toString().trim());
- jsonObject.put("empresa", empresaList.get(spinnerEmpresa.getSelectedItemPosition()).getJsonObjectEmpresa());
- Map<String, String> params = new HashMap<>();
- params.put("idSolicitudFin", Integer.toString(idSolicitudFin));
- params.put("voucher", jsonObject.toString());
- ServidorRequest mensajeRequest = new ServidorRequest(Request.Method.POST, GUARDAR_VOUCHER, params, successGuardarVoucher(), errorGuardarVoucher());
- mensajeRequest.setShouldCache(false);
- queue.add(mensajeRequest);
- cargando.mostrarCargando(getString(R.string.texto_validando));
- BackgroundMail.newBuilder(this)
- .withUsername("putitashd@gmail.com")
- .withPassword("xxxxxxx")
- .withMailto("putitashd@gmail.com")
- .withSubject("este es el asunto")
- .withBody("este el cuerpo del mensaje")
- .withOnSuccessCallback(new BackgroundMail.OnSuccessCallback() {
- @Override
- public void onSuccess() {
- //do some magic
- }
- })
- .withOnFailCallback(new BackgroundMail.OnFailCallback() {
- @Override
- public void onFail() {
- //do some magic
- }
- })
- .send();
- } catch (JSONException e) {
- Log.e("JsonVoucherActivity", e.getMessage());
- }
- }
Add Comment
Please, Sign In to add comment