Witam, chciałbym zaimplementować funkcję, która pobierze datę wpisywaną przez użytkownika w formacie YYYY-MM-DD i wyświetli ją w moim kalendarzu. Nie wiem jak pobrać te dane i sprawić żeby data się wyświetlała. Wygląd i zawartość pliku activity_main.xml poniżej
.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="@color/colorPrimaryDark"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:id="@+id/MyDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Kalendarz"
android:textColor="#FFF"
android:textSize="25sp"
android:layout_marginLeft="120dp"
android:layout_marginTop="50dp"
/>
<LinearLayout
android:layout_marginTop="32dp"
android:background="#FFF"
android:layout_marginLeft="35dp"
android:layout_width="300dp"
android:layout_height="wrap_content">
<CalendarView
android:layout_width="wrap_content"
android:layout_height="320dp">
</CalendarView>
</LinearLayout>
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFF"
android:layout_marginTop="20dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:hint="Wprowadz datę w formacie: YYYY-MM-DD"
android:inputType="text"
/>
<Button
android:layout_marginLeft="130dp"
android:layout_marginTop="20dp"
android:text="Pokaż datę"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>