Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.serviya.ti.serviyapp;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_form_negocio);
- nombren = (EditText)findViewById(R.id.nombren);
- telefonon = (EditText)findViewById(R.id.telefonon);
- direccionnR = (EditText)findViewById(R.id.direccionnR);
- direccionnE = (EditText)findViewById(R.id.direccionnE);
- correon = (EditText)findViewById(R.id.correon);
- observacionesn = (EditText)findViewById(R.id.observacionesn);
- tespecial = (RadioButton)findViewById(R.id.tespecial);
- carga = (RadioButton)findViewById(R.id.carga);
- encomiendan = (RadioButton)findViewById(R.id.encomiendan);
- confirmarnform = (Button)findViewById(R.id.confirmarNform);
- regresarnform = (Button)findViewById(R.id.regresarNform);
- confirmarnform.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (tespecial.isChecked()){
- tipon = "T. Especial";
- }else if (carga.isChecked()){
- tipon = "carga";
- }else if (encomiendan.isChecked()){
- tipon = "encomienda";
- }
- final String nombreform = nombren.getText().toString().trim();
- String registro = "http://miurl.com/micarpeta/registrarn.php?idusuarion=NULL&nombren="+nombreform+"&telefonon="+telefonon.getText()+"&direccionnR="+direccionnR.getText()+"&direccionnE="+direccionnE.getText()+"&correon="+correon.getText()+"&tipon="+tipon+"&observacionesn="+observacionesn.getText();
- EnviarRecibirDatos(registro);
- Intent confirmarnform = new Intent(FormNegocio.this, Fin.class);
- startActivity(confirmarnform);
- }
- });
- regresarnform.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent regresarnform = new Intent(FormNegocio.this, Inicio.class);
- startActivity(regresarnform);
- }
- });
- }
- public void EnviarRecibirDatos(String URL){
- Toast.makeText(getApplicationContext(), "Tenemos tu solicitud", Toast.LENGTH_SHORT).show();
- RequestQueue queue = Volley.newRequestQueue(this);
- StringRequest stringRequest = new StringRequest(Request.Method.GET, URL, new Response.Listener<String>() {
- @Override
- public void onResponse(String response) {
- if (response.length()>0){
- try {
- JSONArray ja = new JSONArray(response);
- Log.i("sizejson",""+ja.length());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
- }
- }, new Response.ErrorListener(){
- @Override
- public void onErrorResponse(VolleyError error) {
- }
- });
- queue.add(stringRequest);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement