-
13.12 保存到 Realm 中
-
新增待办事项,存入Realm数据库:
private fun createTodoFrom(title: EditText, todoContent: EditText) { realm.beginTransaction() // Either update the edited object or create a new one. var t = todo ?: realm.createObject(Todo::class.java) t.id = todo?.id ?: UUID.randomUUID().toString() t.title = title.text.toString() t.content = todoContent.text.toString() realm.commitTransaction() activity.supportFragmentManager.popBackStack() }
- 留下你的读书笔记
- 你还没登录,点击这里
-
用户笔记留言