Android how can i check if calendar date has been selected : I am making a task manager application where I require the following details:- name (string), description (string), date (long) and importance (int).

I am currently stuck on figuring out how to get date and also see if date from calendarView has been selected.

 

    TextView name, description, importance;
        CalendarView calendar;
        Button submit;
        ArrayList<Task> myTasks = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_create_task);

        name = (TextView)findViewById(R.id.CreateTaskNameET);
        description = (TextView)findViewById(R.id.CreateTaskDescriptionET);
        importance = (TextView)findViewById(R.id.CreateTaskImportanceET);
        calendar = (CalendarView) findViewById(R.id.CreateTaskCalender);

        submit = (Button)findViewById(R.id.CreateTaskSubmitBtn);

        submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Task myTask = new Task(name.getText().toString(),
                        description.getText().toString(),
                        calendar.getDate(),
                        Integer.parseInt(importance.getText().toString()));

                myTasks.add(myTask);
            }
        });

    }

    public void validateRule(EditText name, EditText description, CalendarView calendar, EditText importance){
        if(name.getText().equals("")){

        }
        else if(description.getText().equals("")){

        }
        else if(calendar.getDate()){

        }
    }

Once again, how can i determine if the date has been selected as it's one of my validation rule. Thanks