diff --git a/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java b/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java index 5b0d307..12984f0 100644 --- a/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java +++ b/app/src/main/java/com/example/citrusclient/views/CalendarFragment.java @@ -18,6 +18,7 @@ import android.view.ViewTreeObserver; import android.widget.Button; import android.widget.LinearLayout; +import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TableLayout; import android.widget.TableRow; @@ -276,7 +277,16 @@ createBook.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - ((MainActivity) getActivity()).showFragment(new CreateScheduleFragment(year, month, day)); + RadioButton rbSchedule = getActivity().findViewById(R.id.rbSchedule); + RadioButton rbTodo = getActivity().findViewById(R.id.rbTodo); + RadioButton rbBoth = getActivity().findViewById(R.id.rbBoth); + if(rbSchedule != null && rbSchedule.isChecked()) { + ((MainActivity) getActivity()).showFragment(new CreateScheduleFragment(year, month, day)); + } else if(rbTodo != null && rbTodo.isChecked()) { + ((MainActivity) getActivity()).showFragment(new CreateTodoFragment(year, month, day)); + } else if(rbBoth != null && rbBoth.isChecked()) { + ((MainActivity) getActivity()).showFragment(new CreateScheduleFragment(year, month, day)); + } } });