Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Configure o SimpleDateFormat no onCreate ou onCreateView
String pattern = "dd/MM/yyyy";
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
// Durante a confirmacao de cadastro, faça a validacao
String data = NascimentoUsu.getText().toString();
try {
Date date = sdf.parse(data);
// Data formatada corretamente
} catch (ParseException e) {
// Erro de parsing!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment