Skip to content

Commit

Permalink
Fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Anready committed Aug 1, 2024
1 parent c94bebb commit ed8f8e8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/src/main/java/com/anready/croissant/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ class MainActivity : AppCompatActivity() {
return
}

if (savedInstanceState != null) {
path = savedInstanceState.getString("N", "/")
}

FileUtils.getObjectsByFolderId(this)
}

Expand Down Expand Up @@ -93,6 +97,17 @@ class MainActivity : AppCompatActivity() {
}
}

override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putString("N", path)
}


override fun onRestoreInstanceState(savedInstanceState: Bundle) {
super.onRestoreInstanceState(savedInstanceState)
path = savedInstanceState.getString("N", "/")
}

override fun onBackPressed() {
if (path.lastIndexOf("/") > 0) {
path = path.substring(0, path.lastIndexOf("/"))
Expand Down

0 comments on commit ed8f8e8

Please sign in to comment.