moving more db related functions to Room

This commit is contained in:
tibbi
2018-11-07 20:12:07 +01:00
parent 95ab889045
commit 43896a964a
5 changed files with 26 additions and 27 deletions

View File

@ -236,16 +236,16 @@ class MainActivity : SimpleActivity() {
}
private fun handleUri(uri: Uri) {
val id = dbHelper.getNoteId(uri.path)
NotesHelper(this).getNoteIdWithPath(uri.path) {
if (it != null && it > 0L) {
updateSelectedNote(it)
return@getNoteIdWithPath
}
if (id > 0) {
updateSelectedNote(id)
return
}
handlePermission(PERMISSION_WRITE_STORAGE) {
if (it) {
importFileWithSync(uri)
handlePermission(PERMISSION_WRITE_STORAGE) {
if (it) {
importFileWithSync(uri)
}
}
}
}