elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Temas
Páginas: [1]
1  Programación / Java / Validar información editText Android en: 1 Marzo 2015, 18:55 pm
Buenas tardes, tengo una duda con respecto a una información que estoy ingresando por botones a una calculadora en Android Studio por medio un editText, pero solo me ingresa a un solo EditText

 public void prueba(View view){
        EditText num1 = (EditText) findViewById(R.id.num1);
        String strNum1 = num1.getText().toString();
        switch (view.getId()){
            case R.id.boton0:
                strNum1 = strNum1 + "0";
                break;
            case R.id.boton1:
                strNum1 = strNum1 + "1";
                break;
            case R.id.boton2:
                strNum1 = strNum1 + "2";
                break;
            case R.id.boton3:
                strNum1 = strNum1 + "3";
                break;
            case R.id.boton4:
                strNum1 = strNum1 + "4";
                break;
            case R.id.boton5:
                strNum1 = strNum1 + "5";
                break;
            case R.id.boton6:
                strNum1 = strNum1 + "6";
                break;
            case R.id.boton7:
                strNum1 = strNum1 + "7";
                break;
            case R.id.boton8:
                strNum1 = strNum1 + "8";
                break;
            case R.id.boton9:
                strNum1 = strNum1 + "9";
                break;
            default:
                Toast.makeText(this, "Ha sucedido un error", Toast.LENGTH_LONG).show();
                break;
        }

            num1.setText(strNum1);
    }
En esa parte del codigo asigno los numeros al editText num1, pero quiero tambien ingresar esos mismos numeros a un edit Text 2, que podría hacer, sería de gran ayuda sus ideas, muchas gracias

 :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\ :-\
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines