mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
check storage permission before getting latest media id
This commit is contained in:
parent
6976c35ee4
commit
c271822844
1 changed files with 4 additions and 1 deletions
|
@ -17,6 +17,7 @@ import com.simplemobiletools.commons.dialogs.CreateNewFolderDialog
|
||||||
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
import com.simplemobiletools.commons.dialogs.FilePickerDialog
|
||||||
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
import com.simplemobiletools.commons.dialogs.RadioGroupDialog
|
||||||
import com.simplemobiletools.commons.extensions.*
|
import com.simplemobiletools.commons.extensions.*
|
||||||
|
import com.simplemobiletools.commons.helpers.PERMISSION_READ_STORAGE
|
||||||
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
|
import com.simplemobiletools.commons.helpers.PERMISSION_WRITE_STORAGE
|
||||||
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED
|
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED
|
||||||
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN
|
import com.simplemobiletools.commons.helpers.SORT_BY_DATE_TAKEN
|
||||||
|
@ -634,7 +635,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
||||||
|
|
||||||
private fun setupLatestMediaId() {
|
private fun setupLatestMediaId() {
|
||||||
Thread {
|
Thread {
|
||||||
mLatestMediaId = getLatestMediaId()
|
if (hasPermission(PERMISSION_READ_STORAGE)) {
|
||||||
|
mLatestMediaId = getLatestMediaId()
|
||||||
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue