java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details.
at android.os.Looper.getMainLooper(Looper.java)
at android.arch.core.executor.DefaultTaskExecutor.isMainThread(DefaultTaskExecutor.java:58)
at android.arch.core.executor.AppToolkitTaskExecutor.isMainThread(AppToolkitTaskExecutor.java:115)
at android.arch.lifecycle.LiveData.assertMainThread(LiveData.java:408)
at android.arch.lifecycle.LiveData.setValue(LiveData.java:290)
at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
at pl.pbochenski.archcomponentstest.MainViewModelTest.shouldGetPostsAndHaveACopyOfIt(MainViewModelTest.kt:48) ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//private methods: | |
void readKeyboard(); | |
void resetButtons(); | |
void advanceButtons(); | |
void pushToSerial(); | |
byte getPitch(int i); | |
void midi_note_off(byte key); | |
void midi_note_on(byte key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainViewModel(app: Application) : AndroidViewModel(app) { | |
private val postRepo = getApplication<App>().postRepo | |
private val LOAD_ITEM_COUNT = 15 | |
fun getPosts(): LiveData<List<Post>> { | |
return postRepo.posts.map { | |
it.map { Post(it.id, it.title, it.url) } | |
} | |
} | |
I hereby claim:
- I am pbochenski on github.
- I am pbochenski (https://keybase.io/pbochenski) on keybase.
- I have a public key ASACh_c5xS4LldtUYAA93fRgyYJEQA_8FLHVaS-y5mdkYgo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
interface AppComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle | |
import androidx.annotation.StringRes | |
import androidx.appcompat.app.AlertDialog | |
import androidx.core.os.bundleOf | |
import androidx.fragment.app.DialogFragment |