How to pass an EditText from Android to Integer

0

I am a beginner in programming and I found this problem in Android Studio.

I have

EditText codNegocio;


codNegocio = (EditText) findViewById(R.id.txtnegocio);

The thing is that I want to insert numeric data in that edit text since the row of my table in my BD has an int data type ... and when I want to insert data from my web service, it does not recognize me ...

here the code:

  }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String,String> parametros=new HashMap<String, String>();
                parametros.put("NombreUsuario",nombre.getText().toString());
                parametros.put("ApellidoUsuario",apellido.getText().toString());
                parametros.put("usuariologin",user.getText().toString());
                parametros.put("usuariopasword",contraseña.getText().toString());
                parametros.put("DirecciondeCorreo",correo.getText().toString());

                **parametros.put("NombreNegocio",Integer.parseInt(negocio.getText().toString().trim()));**

please help ....

    
asked by Cristaldino Solano Segovia Qui 10.12.2018 в 06:54
source

0 answers