Two things:
- Call
.show()
on the Toast you made. 2000
is not a valid parameter for the Toast. That will not make it show up for 2000 ms. The only parameter that the Toast accepts for that isToast.LENGTH_SHORT
orToast.LENGTH_LONG
So:
Change these lines:
Toast.makeText(contexto, "Debe aceptar los términos", 2000);
Toast.makeText(contexto, "Debe ingresar su número", 2000);
to these lines:
Toast.makeText(contexto, "Debe aceptar los términos", Toast.LENGTH_SHORT).show();
Toast.makeText(contexto, "Debe ingresar su número", Toast.LENGTH_SHORT).show();
Toast.LENGTH_SHORT
is 2000 ms (2 seconds), and Toast.LENGTH_LONG
is 3500 ms (3.5 seconds).
Toast.LENGTH_SHORT == 0
so you can pass is0
instead.Toast.LENGTH_LONG == 1
so you can pass it1
instead.
Visit Android's documentation on Toast for detailed information.