mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-14 09:57:31 -04:00
Fixed application crash while running application on the emulators.
This commit is contained in:
parent
429502af19
commit
3d7a4af7d3
@ -18,6 +18,7 @@
|
||||
|
||||
package org.kiwix.kiwixmobile.core.dao
|
||||
|
||||
import android.os.Build
|
||||
import io.reactivex.BackpressureStrategy
|
||||
import io.reactivex.BackpressureStrategy.LATEST
|
||||
import io.reactivex.Flowable
|
||||
@ -46,9 +47,16 @@ class LibkiwixBookmarks @Inject constructor(
|
||||
}
|
||||
|
||||
private val bookmarksFolderPath: String by lazy {
|
||||
sharedPreferenceUtil.getPublicDirectoryPath(
|
||||
sharedPreferenceUtil.defaultStorage()
|
||||
) + "/kiwix/Bookmarks/"
|
||||
if (Build.DEVICE.contains("generic")) {
|
||||
// Workaround for emulators: Emulators have limited memory and
|
||||
// restrictions on creating folders, so we will use the default
|
||||
// path for saving the bookmark file.
|
||||
sharedPreferenceUtil.context.filesDir.path
|
||||
} else {
|
||||
sharedPreferenceUtil.getPublicDirectoryPath(
|
||||
sharedPreferenceUtil.defaultStorage()
|
||||
) + "/kiwix/Bookmarks/"
|
||||
}
|
||||
}
|
||||
|
||||
private val bookmarkFile: File by lazy {
|
||||
|
Loading…
x
Reference in New Issue
Block a user