mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-02-26 08:07:41 +01:00
show a toast if the title already exists, when opening a file
This commit is contained in:
parent
807b8409a0
commit
28ed5c654f
@ -165,9 +165,13 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
||||
toast(R.string.file_too_large)
|
||||
} else {
|
||||
val filename = it.getFilenameFromPath()
|
||||
val content = File(it).readText()
|
||||
val note = Note(0, filename, content, TYPE_NOTE)
|
||||
addNewNote(note)
|
||||
if (mDb.doesTitleExist(filename)) {
|
||||
toast(R.string.title_taken)
|
||||
} else {
|
||||
val content = File(it).readText()
|
||||
val note = Note(0, filename, content, TYPE_NOTE)
|
||||
addNewNote(note)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user