mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-14 18:06:39 -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
|
package org.kiwix.kiwixmobile.core.dao
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import io.reactivex.BackpressureStrategy
|
import io.reactivex.BackpressureStrategy
|
||||||
import io.reactivex.BackpressureStrategy.LATEST
|
import io.reactivex.BackpressureStrategy.LATEST
|
||||||
import io.reactivex.Flowable
|
import io.reactivex.Flowable
|
||||||
@ -46,9 +47,16 @@ class LibkiwixBookmarks @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val bookmarksFolderPath: String by lazy {
|
private val bookmarksFolderPath: String by lazy {
|
||||||
sharedPreferenceUtil.getPublicDirectoryPath(
|
if (Build.DEVICE.contains("generic")) {
|
||||||
sharedPreferenceUtil.defaultStorage()
|
// Workaround for emulators: Emulators have limited memory and
|
||||||
) + "/kiwix/Bookmarks/"
|
// 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 {
|
private val bookmarkFile: File by lazy {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user