1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-23 00:33:09 +02:00

set the user default birthday to minus 20 years from the current year.

This commit is contained in:
OliE
2018-01-28 10:49:17 +01:00
parent 0c65d09609
commit 2edc39636a

View File

@@ -21,9 +21,7 @@ import android.app.DatePickerDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
@@ -90,6 +88,11 @@ public class UserSettingsActivity extends Activity {
btnCancel.setOnClickListener(new onClickListenerCancel());
btnDelete.setOnClickListener(new onClickListenerDelete());
Calendar birthdayCal = Calendar.getInstance();
birthdayCal.setTime(birthday);
birthdayCal.add(Calendar.YEAR, -20);
birthday = birthdayCal.getTime();
txtBirthday.setText(dateFormat.format(birthday));
txtGoalDate.setText(dateFormat.format(goal_date));