avoid duplicate folder initialization at app startup

This commit is contained in:
tibbi 2017-09-03 20:35:05 +02:00
parent 2532c43f7e
commit 4d5a4098b4
1 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
storeConfigVariables()
breadcrumbs.setListener(this)
tryInitFileManager()
storeStoragePaths()
@ -62,7 +63,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
override fun onPause() {
super.onPause()
storedTextColor = config.textColor
storeConfigVariables()
}
override fun onDestroy() {
@ -70,6 +71,10 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
config.temporarilyShowHidden = false
}
private fun storeConfigVariables() {
storedTextColor = config.textColor
}
private fun tryInitFileManager() {
if (hasWriteStoragePermission()) {
initRootFileManager()