This kind of library might help: https://github.com/bostonandroid/DatePreference
<org.bostonandroid.datepreference.DatePreference
android:key="age" android:title="@string/babybirthday"
android:defaultValue="1991.01.01" />
Then I guess you are skilled enough to substract 2 Dates ;-) If not, the link given by Lucifer in comment is very good.