Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/188.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 房间插入完成在两次或三次插入后停止工作_Android_Android Room - Fatal编程技术网

Android 房间插入完成在两次或三次插入后停止工作

Android 房间插入完成在两次或三次插入后停止工作,android,android-room,Android,Android Room,我在房间里有一个简单的插入,但由于一个奇怪的原因,在插入两三次后,我的插入在我的应用程序中不起作用。还有另一个奇怪的行为,当插入时,我成功地插入了,但是当查看数据库时,什么都没有 DAO @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(entryTable: EntryTable): Completable 视图模型 entryRepository.saveEntryTable(EntryTable(fieldId, en

我在房间里有一个简单的插入,但由于一个奇怪的原因,在插入两三次后,我的插入在我的应用程序中不起作用。还有另一个奇怪的行为,当插入时,我成功地插入了,但是当查看数据库时,什么都没有

DAO

@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insert(entryTable: EntryTable): Completable
视图模型

entryRepository.saveEntryTable(EntryTable(fieldId, entryId, tabId, index))
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    Timber.d("<<<<<row saved!")
                    result.value = Status.SUCCESS
                }, {
                    Timber.e(it)
                    Timber.d("<<<<<<<<<<<row not saved!")
                    result.value = Status.ERROR
                })
entryRepository.saventrytable(EntryTable(fieldId、entryId、tabId、index))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.订阅({

Timber.d(“我找到了一个答案,或者我可以说一个解决方案,但目前我不明白为什么这种行为会改变,因为我没有在我的应用程序中改变任何东西

通过将日志模式从提前写入日志记录(或自动)更改为截断,我的所有更改都直接在数据库中执行,我没有任何奇怪的内存数据库