always check internal storage path and sd card path at startup
This commit is contained in:
parent
170c4c911f
commit
d9ee3220a3
2 changed files with 4 additions and 7 deletions
|
@ -56,13 +56,11 @@ fun Activity.showErrorToast(exception: Exception, length: Int = Toast.LENGTH_LON
|
|||
|
||||
@SuppressLint("NewApi")
|
||||
fun Activity.storeStoragePaths() {
|
||||
if (baseConfig.appRunCount == 0) {
|
||||
baseConfig.internalStoragePath = getInternalStoragePath()
|
||||
baseConfig.internalStoragePath = getInternalStoragePath()
|
||||
|
||||
Thread({
|
||||
baseConfig.sdCardPath = getSDCardPath().trimEnd('/')
|
||||
}).start()
|
||||
}
|
||||
Thread({
|
||||
baseConfig.sdCardPath = getSDCardPath().trimEnd('/')
|
||||
}).start()
|
||||
|
||||
baseConfig.appRunCount++
|
||||
if (!isThankYouInstalled() && (baseConfig.appRunCount == 50 || baseConfig.appRunCount == 300 || baseConfig.appRunCount == 1000)) {
|
||||
|
|
|
@ -26,7 +26,6 @@ import com.simplemobiletools.commons.helpers.PREFS_KEY
|
|||
import com.simplemobiletools.commons.views.*
|
||||
import kotlinx.android.synthetic.main.dialog_title.view.*
|
||||
|
||||
|
||||
fun Context.isOnMainThread() = Looper.myLooper() == Looper.getMainLooper()
|
||||
fun Context.getSharedPrefs() = getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE)
|
||||
|
||||
|
|
Loading…
Reference in a new issue