diff --git a/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java b/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java index 722398e..0d9935a 100644 --- a/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java +++ b/app/src/main/java/com/example/citrusclient/viewmodels/TodosViewModel.java @@ -43,11 +43,14 @@ this.errorLiveData = new MutableLiveData<>(); } - //getter - public MutableLiveData>>>> getTodosLiveData() + //LiveData恮getter + public MutableLiveData>>>> getAllTodosLiveData() { return allTodosLiveData; } + public MutableLiveData>> getTodosByMonthLiveData() {return TodosByMonthLiveData;} + public MutableLiveData> getTodosByDayLiveData() {return TodosByDayLiveData;} + public MutableLiveData getTodoByIdLiveData() {return TodoByIdLiveData;} public MutableLiveData getErrorLiveData() {return errorLiveData;} @@ -152,7 +155,7 @@ public void onResponse(Call call, Response response) { if (response.isSuccessful()) { System.out.println("Success: createTodo"); - + TodoByIdLiveData.setValue(response.body()); } else { System.out.println("Error: createTodo" + response.code()); }