always check internal storage path and sd card path at startup

This commit is contained in:
tibbi 2017-10-05 19:09:41 +02:00
parent 170c4c911f
commit d9ee3220a3
2 changed files with 4 additions and 7 deletions

View file

@ -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)) {

View file

@ -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)