Build a Android Age Calculator From Date of Birth (DOB) App in Java Full Project With Source Code For Beginners

Build a Android Age Calculator From Date of Birth (DOB) App in Java Full Project With Source Code For Beginners

 

Welcome folks today in this blog post we will be building a android age calculator from date of birth (dob) app in java.All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an activity_main.xml file and copy paste the following code

 

 

activity_main.xml

 

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#232121"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:orientation="vertical">

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="vertical">

        <LinearLayout
            android:id="@+id/llDate"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:id="@+id/LinearLayout02"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_marginTop="10dp"
                android:orientation="vertical">

                <RelativeLayout
                    android:id="@+id/llAgein"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/TextView01"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Today's Date"
                        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                        android:textColor="#45c3ff" />

                    <TextView
                        android:id="@+id/textViewCurrentDay"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentBottom="true"
                        android:layout_alignParentEnd="true"
                        android:layout_marginBottom="1dp"
                        android:layout_marginEnd="3dp"
                        android:textColor="#aaffffff"
                        android:textSize="14sp" />
                </RelativeLayout>

                <FrameLayout
                    android:id="@+id/FrameLayout1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <LinearLayout
                        android:id="@+id/lldate1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/border_edittext">

                        <EditText
                            android:id="@+id/editTextCurrentDay"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="#00000000"
                            android:ellipsize="end"
                            android:gravity="start"
                            android:hint="dd"
                            android:inputType="textCapCharacters|number|numberSigned|numberDecimal|numberPassword|phone"
                            android:maxLength="2"
                            android:nextFocusDown="@+id/etTMonth"
                            android:padding="10dp"
                            android:selectAllOnFocus="true"
                            android:textColor="#fff"
                            android:textSize="20sp" />

                        <TextView
                            android:id="@+id/tvSeprator1"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="-"
                            android:textColor="#fff" />

                        <EditText
                            android:id="@+id/editTextCurrentMonth"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="#00000000"
                            android:ellipsize="end"
                            android:gravity="top|bottom|left|right|center_vertical|fill_vertical|center_horizontal|fill_horizontal|center|fill|start|end"
                            android:hint="mm"
                            android:inputType="textCapCharacters|number|numberSigned|numberDecimal|numberPassword|phone"
                            android:maxLength="2"
                            android:nextFocusDown="@+id/etTYear"
                            android:padding="10dp"
                            android:selectAllOnFocus="true"
                            android:textColor="#fff"
                            android:textSize="20sp" />

                        <TextView
                            android:id="@+id/tvSeprator2"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="-"
                            android:textColor="#fff" />

                        <EditText
                            android:id="@+id/editTextCurrentYear"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="#00000000"
                            android:ellipsize="end"
                            android:hint="yyyy"
                            android:inputType="textCapCharacters|number|numberSigned|numberDecimal|numberPassword|phone"
                            android:maxLength="4"
                            android:nextFocusDown="@+id/etBDay"
                            android:padding="10dp"
                            android:selectAllOnFocus="true"
                            android:textColor="#fff"
                            android:textSize="20sp" />
                    </LinearLayout>

                    <ImageView
                        android:id="@+id/imageViewCalenderFirst"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="end"
                        android:contentDescription="Calender"
                        android:src="@drawable/calendar" />
                </FrameLayout>

                <RelativeLayout
                    android:id="@+id/llAgein2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/TextView02"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Date Of Birth"
                        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                        android:textColor="#45c3ff" />
                </RelativeLayout>

                <FrameLayout
                    android:id="@+id/FrameLayout2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <LinearLayout
                        android:id="@+id/lldate2"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/border_edittext">

                        <EditText
                            android:id="@+id/editTextBirthDay"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="#00000000"
                            android:ellipsize="end"
                            android:gravity="start"
                            android:hint="dd"
                            android:inputType="textCapCharacters|number|numberSigned|numberDecimal|numberPassword|phone"
                            android:maxLength="2"
                            android:nextFocusDown="@+id/etTMonth"
                            android:padding="10dp"
                            android:selectAllOnFocus="true"
                            android:textColor="#fff"
                            android:textColorHint="#8e8e8e"
                            android:textSize="20sp" />

                        <TextView
                            android:id="@+id/tvSeprator3"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="-"
                            android:textColor="#fff" />

                        <EditText
                            android:id="@+id/editTextBirthMonth"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="#00000000"
                            android:ellipsize="end"
                            android:hint="mm"
                            android:inputType="textCapCharacters|number|numberSigned|numberDecimal|numberPassword|phone"
                            android:maxLength="2"
                            android:nextFocusDown="@+id/etTYear"
                            android:padding="10dp"
                            android:selectAllOnFocus="true"
                            android:textColor="#fff"
                            android:textColorHint="#8e8e8e"
                            android:textSize="20sp" />

                        <TextView
                            android:id="@+id/tvSeprator4"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="-"
                            android:textColor="#fff" />

                        <EditText
                            android:id="@+id/editTextBirthYear"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:background="#00000000"
                            android:ellipsize="end"
                            android:hint="yyyy"
                            android:inputType="textCapCharacters|number|numberSigned|numberDecimal|numberPassword|phone"
                            android:maxLength="4"
                            android:nextFocusDown="@+id/etBDay"
                            android:padding="10dp"
                            android:selectAllOnFocus="true"
                            android:textColor="#fff"
                            android:textColorHint="#8e8e8e"
                            android:textSize="20sp" />
                    </LinearLayout>

                    <ImageView
                        android:id="@+id/imageViewCalenderSecond"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="end"
                        android:contentDescription="Calender"
                        android:src="@drawable/calendar" />
                </FrameLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="20dp"
                    android:background="#23b17e">

                    <TextView
                        android:id="@+id/textViewCalculate"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1.0"
                        android:background="@drawable/btn_green"
                        android:gravity="center"
                        android:paddingBottom="7dp"
                        android:paddingTop="7dp"
                        android:text="Calculate"
                        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                        android:textColor="#ffffff" />

                    <View
                        android:id="@+id/view1"
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:background="#aaffffff" />

                    <TextView
                        android:id="@+id/textViewClear"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1.0"
                        android:background="@drawable/btn_green"
                        android:gravity="center"
                        android:paddingBottom="7dp"
                        android:paddingTop="7dp"
                        android:text="Clear"
                        android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                        android:textColor="#ffffff" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/llAge"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="20dp"
                    android:orientation="vertical">

                    <RelativeLayout
                        android:id="@id/llAgein2"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                        <TextView
                            android:id="@+id/textView4"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="1dp"
                            android:text="Age"
                            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                            android:textColor="#00ffbb" />

                        <TextView
                            android:id="@+id/tvTotalDays"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentBottom="true"
                            android:layout_alignParentEnd="true"
                            android:layout_marginEnd="3dp"
                            android:textColor="#aaffffff"
                            android:textSize="14sp"
                            android:visibility="gone" />
                    </RelativeLayout>

                    <LinearLayout
                        android:id="@+id/linearLayout3"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/border_edittext"
                        android:orientation="vertical"
                        android:paddingBottom="10dp"
                        android:paddingTop="10dp">

                        <LinearLayout
                            android:id="@+id/LinearLayout01"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:gravity="top|bottom|center_vertical|fill_vertical|center|fill">

                            <TextView
                                android:id="@id/TextView02"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="20dp"
                                android:layout_weight="1.0"
                                android:text="Years"
                                android:textColor="#00ffbb" />

                            <TextView
                                android:id="@+id/TextView04"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.0"
                                android:text="Months"
                                android:textColor="#00ffbb" />

                            <TextView
                                android:id="@+id/TextView03"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.0"
                                android:text="Days"
                                android:textColor="#00ffbb" />
                        </LinearLayout>

                        <LinearLayout
                            android:id="@+id/linearLayout4"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content">

                            <TextView
                                android:id="@+id/textViewFinalYears"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="20dp"
                                android:layout_weight="1.0"
                                android:text="00"
                                android:textColor="#fff"
                                android:textSize="30sp" />

                            <TextView
                                android:id="@+id/textViewFinalMonths"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.0"
                                android:text="00"
                                android:textColor="#fff"
                                android:textSize="30sp" />

                            <TextView
                                android:id="@+id/textViewFinalDays"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.0"
                                android:text="00"
                                android:textColor="#fff"
                                android:textSize="30sp" />
                        </LinearLayout>

                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/LinearLayout03"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp"
                    android:layout_marginTop="10dp"
                    android:orientation="vertical">

                    <RelativeLayout
                        android:id="@+id/RelativeLayout01"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">

                        <TextView
                            android:id="@+id/TextView08"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="1dp"
                            android:text="Next Birthday"
                            android:textAppearance="@style/TextAppearance.AppCompat.Medium"
                            android:textColor="#00ffbb" />

                        <TextView
                            android:id="@+id/tvBirthDay"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentBottom="true"
                            android:layout_alignParentRight="true"
                            android:layout_marginRight="3dp"
                            android:textColor="#aaffffff"
                            android:textSize="14sp"
                            android:visibility="gone" />
                    </RelativeLayout>

                    <LinearLayout
                        android:id="@+id/LinearLayout05"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="@drawable/border_edittext"
                        android:orientation="vertical"
                        android:padding="10dp">

                        <LinearLayout
                            android:id="@+id/LinearLayout06"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:gravity="top|bottom|center_vertical|fill_vertical|center|fill">

                            <TextView
                                android:id="@+id/TextView14"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="20dp"
                                android:layout_weight="1.0"
                                android:text="Months"
                                android:textColor="#00ffbb" />

                            <TextView
                                android:id="@+id/TextView15"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.0"
                                android:text="Days"
                                android:textColor="#00ffbb" />
                        </LinearLayout>

                        <LinearLayout
                            android:id="@+id/LinearLayout04"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <TextView
                                android:id="@+id/textViewNextBirthdayMonths"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="20dp"
                                android:layout_weight="1.0"
                                android:text="00"
                                android:textColor="#fff"
                                android:textSize="30sp" />

                            <TextView
                                android:id="@+id/textViewNextBirthdayDays"
                                android:layout_width="0dp"
                                android:layout_height="wrap_content"
                                android:layout_weight="1.0"
                                android:text="00"
                                android:textColor="#fff"
                                android:textSize="30sp" />
                        </LinearLayout>

                    </LinearLayout>

                </LinearLayout>

            </LinearLayout>

        </LinearLayout>

    </ScrollView>

</RelativeLayout>

 

READ  How to get Current Date and Time Programmatically in your Android App Using Android Studio and Java Full Project For Beginners

 

 

And now make copy paste the java code inside the MainActvity.java file as shown below

 

 

MainActvity.java

 

 

package com.example.rumi.agecalculator;

import android.app.DatePickerDialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.Period;
import java.time.ZoneId;
import java.util.Calendar;
import java.util.Date;

import butterknife.BindView;
import butterknife.ButterKnife;
import es.dmoral.toasty.Toasty;

public class MainActivity extends AppCompatActivity
        implements View.OnClickListener {

    @BindView(R.id.textViewNextBirthdayMonths)
    TextView textViewNextBirthdayMonths;
    @BindView(R.id.textViewNextBirthdayDays)
    TextView textViewNextBirthdayDays;
    @BindView(R.id.textViewFinalYears)
    TextView textViewFinalYears;
    @BindView(R.id.textViewFinalMonths)
    TextView textViewFinalMonths;
    @BindView(R.id.textViewFinalDays)
    TextView textViewFinalDays;
    @BindView(R.id.textViewCurrentDay)
    TextView textViewCurrentDay;
    @BindView(R.id.textViewCalculate)
    TextView textViewCalculate;
    @BindView(R.id.textViewClear)
    TextView textViewClear;
    @BindView(R.id.imageViewCalenderFirst)
    ImageView imageViewCalenderFirst;
    @BindView(R.id.imageViewCalenderSecond)
    ImageView imageViewCalenderSecond;
    @BindView(R.id.editTextBirthDay)
    EditText editTextBirthDay;
    @BindView(R.id.editTextBirthMonth)
    EditText editTextBirthMonth;
    @BindView(R.id.editTextBirthYear)
    EditText editTextBirthYear;
    @BindView(R.id.editTextCurrentDay)
    EditText editTextCurrentDay;
    @BindView(R.id.editTextCurrentMonth)
    EditText editTextCurrentMonth;
    @BindView(R.id.editTextCurrentYear)
    EditText editTextCurrentYear;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        setupCurrentDate(); // setup today's date

        textViewCalculate.setOnClickListener(this);
        textViewClear.setOnClickListener(this);
        imageViewCalenderSecond.setOnClickListener(this);
        imageViewCalenderFirst.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main_menu, menu);
        return true;
    }

    private void setupCurrentDate() {
        final Calendar c = Calendar.getInstance();
        editTextCurrentYear.setText(String.valueOf(c.get(Calendar.YEAR)));
        editTextCurrentMonth.setText(addZero(c.get(Calendar.MONTH) + 1));
        editTextCurrentDay.setText(addZero(c.get(Calendar.DAY_OF_MONTH)));

        SimpleDateFormat simpledateformat = new SimpleDateFormat("EEEE");
        Date date = new Date(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH) - 1);
        String dayOfWeek = simpledateformat.format(date);
        textViewCurrentDay.setText(dayOfWeek);
        textViewCurrentDay.setVisibility(View.VISIBLE);
    }

    private String addZero(int number) {
        String n;
        if (number < 10) {
            n = "0" + number;
        } else {
            n = String.valueOf(number);
        }
        return n;
    }


    @Override
    public void onClick(View view) {
        if (view.getId() == R.id.imageViewCalenderSecond) {
            final Calendar c = Calendar.getInstance();
            int mYear = c.get(Calendar.YEAR);
            int mMonth = c.get(Calendar.MONTH);
            int mDay = c.get(Calendar.DAY_OF_MONTH);

            DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
                @Override
                public void onDateSet(DatePicker view, int year,
                                      int monthOfYear, int dayOfMonth) {

                    editTextBirthDay.setText(addZero(dayOfMonth));
                    editTextBirthMonth.setText(addZero(monthOfYear + 1));
                    editTextBirthYear.setText(String.valueOf(year));
                }
            }, mYear, mMonth, mDay);
            datePickerDialog.show();
        } else if (view == textViewCalculate) {
            if (!TextUtils.isEmpty(editTextBirthDay.getText()) && !TextUtils.isEmpty(editTextBirthMonth.getText()) && !TextUtils.isEmpty(editTextBirthYear.getText())) {
                calculateAge();
                nextBirthday();
            } else {
                Toasty.warning(MainActivity.this, "All fields are required", Toast.LENGTH_SHORT, true).show();
            }
        } else if (view == textViewClear) {
            editTextBirthDay.setText("");
            editTextBirthMonth.setText("");
            editTextBirthYear.setText("");
            Toasty.success(MainActivity.this, "Successfully reset", Toast.LENGTH_SHORT, true).show();
        }
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == R.id.about) {
            startActivity(new Intent(this, AboutActivity.class));
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    private void nextBirthday() {
        int currentDay = Integer.valueOf(editTextCurrentDay.getText().toString());
        int currentMonth = Integer.valueOf(editTextCurrentMonth.getText().toString());
        int currentYear = Integer.valueOf(editTextCurrentYear.getText().toString());

        Calendar current = Calendar.getInstance();
        current.set(currentYear, currentMonth, currentDay);

        int birthDay = Integer.valueOf(editTextBirthDay.getText().toString());
        int birthMonth = Integer.valueOf(editTextBirthMonth.getText().toString());
        int birthYear = Integer.valueOf(editTextBirthYear.getText().toString());

        Calendar birthday = Calendar.getInstance();
        birthday.set(birthYear, birthMonth, birthDay);

        long difference = birthday.getTimeInMillis() - current.getTimeInMillis();

        Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(difference);

        textViewNextBirthdayMonths.setText(String.valueOf(cal.get(Calendar.MONTH)));
        textViewNextBirthdayDays.setText(String.valueOf(cal.get(Calendar.DAY_OF_MONTH)));
    }

    private void calculateAge() {
        int currentDay = Integer.valueOf(editTextCurrentDay.getText().toString());
        int currentMonth = Integer.valueOf(editTextCurrentMonth.getText().toString());
        int currentYear = Integer.valueOf(editTextCurrentYear.getText().toString());

        Date now = new Date(currentYear, currentMonth, currentDay);

        int birthDay = Integer.valueOf(editTextBirthDay.getText().toString());
        int birthMonth = Integer.valueOf(editTextBirthMonth.getText().toString());
        int birthYear = Integer.valueOf(editTextBirthYear.getText().toString());

        Date dob = new Date(birthYear, birthMonth, birthDay);

        if (dob.after(now)) {
            Toasty.error(MainActivity.this, "Birthday can't in future", Toast.LENGTH_SHORT, true).show();
            return;
        }
        // days of every month
        int month[] = {31, 28, 31, 30, 31, 30, 31,
                31, 30, 31, 30, 31};

        // if birth date is greater then current birth
        // month then do not count this month and add 30
        // to the date so as to subtract the date and
        // get the remaining days
        if (birthDay > currentDay) {
            currentDay = currentDay + month[birthMonth - 1];
            currentMonth = currentMonth - 1;
        }

        // if birth month exceeds current month, then do
        // not count this year and add 12 to the month so
        // that we can subtract and find out the difference
        if (birthMonth > currentMonth) {
            currentYear = currentYear - 1;
            currentMonth = currentMonth + 12;
        }

        // calculate date, month, year
        int calculated_date = currentDay - birthDay;
        int calculated_month = currentMonth - birthMonth;
        int calculated_year = currentYear - birthYear;

        textViewFinalDays.setText(String.valueOf(calculated_date));
        textViewFinalMonths.setText(String.valueOf(calculated_month));
        textViewFinalYears.setText(String.valueOf(calculated_year));
    }
}

 

READ  How to Increase the Speed of Gradle in Android Studio

 

 

 

 

 

DOWNLOAD FULL SOURCE CODE

 

 

Leave a Reply