TuG*_*llo 1 android android-edittext android-button android-toast
在按照以下条件单击"boton_continuar"按钮时,我正在尝试显示吐司:EditExt vacuum(numero_celular)和ckeckbox(check)选中no.这是我的代码
boton_continuar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
//Verificamos que se halla clikeado y se halla ingresado
if(check.isChecked() && numero_celular.getText().length() != 0){
Intent intent = new Intent(RegisterActivity.this, PrincipalActivity.class);
startActivity(intent);
}else{
Context contexto = getApplicationContext();
if(!check.isChecked()){
Toast.makeText(contexto, "Debe aceptar los términos", 2000);
}
if(numero_celular.getText().length() == 0){
Toast.makeText(contexto, "Debe ingresar su número", 2000);
}
}
}});
Run Code Online (Sandbox Code Playgroud)
务必.show()
在祝酒后打电话.
boton_continuar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
//Verificamos que se halla clikeado y se halla ingresado
if(check.isChecked() && numero_celular.getText().length() != 0){
Intent intent = new Intent(RegisterActivity.this, PrincipalActivity.class);
startActivity(intent);
} else {
Context contexto = getApplicationContext();
if(!check.isChecked()){
Toast.makeText(contexto, "Debe aceptar los términos", 2000).show();
}
if(numero_celular.getText().length() == 0){
Toast.makeText(contexto, "Debe ingresar su número", 2000).show();
}
}
}});
Run Code Online (Sandbox Code Playgroud)