google-developer-training / advanced-android-testing

Android Testing Codelab
https://codelabs.developers.google.com/codelabs/android-testing/
Apache License 2.0
1.01k stars 677 forks source link

[Codelab Issue] Testing Codelab 5.1, Step 8 - Issue description #166

Closed helloworld10010 closed 4 years ago

helloworld10010 commented 4 years ago

Describe the problem A clear and concise description of what the problem is. when i given viewmodel and add a task then run,get error

java.lang.IllegalStateException: Cannot invoke setValue on a background thread
at androidx.lifecycle.LiveData.assertMainThread(LiveData.java:461)
at androidx.lifecycle.LiveData.setValue(LiveData.java:304)
at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
at com.example.android.architecture.blueprints.todoapp.tasks.TasksViewModel.setFilter(TasksViewModel.kt:137)

In which lesson and step of the codelab can this issue be found? 5.1, Step 8

How to reproduce? What are the exact steps to reproduce the problem? when i given viewmodel and add a task then run Versions

  1. What version of Android Studio are you using? 3.6.2 Additional information Add any other context about the problem here.

codelab: advanced-android-kotlin

helloworld10010 commented 4 years ago

next section rule solve this problem