I have this code:
aktiv_date = dateaktiv.getText().toString();
SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy");
try {
aktiv_dat = formatter.parse(aktiv_date);
} catch (java.text.ParseException e) {
e.printStackTrace();
}
When I give it a number like: 12101989 or something similar, that does not have the format dd.MM.yyyy the program crashes because it says the data from aktiv_date is unparseable at line:
aktiv_dat = formatter.parse(aktiv_date);
What could i do to make it not crash?