Am trying to store a date object in Android.I want to get the date as a String from EditText
and then "convert" or should i say store it as a Date
object.This is what i have done.
I have a TextField
`EditText dateOfBirthTextField = (EditText) findViewById(R.id.DoBTextField);`
and then a String
`String dateOfBirth = dateOfBirthTextField.getText().toString();`
Now i have a Student
class that has a dateOfBirth
field of type Date
and a method
`setDateOfBirth(Date dob){
this.dateOfBirth=dob;
}
How do i set the value of dateOfBirth
with what ever is entered into dateOfBirthTextField
?