MainActivity: basic UI state restore
This commit is contained in:
parent
b26feaeb46
commit
01d01e315b
|
@ -61,6 +61,18 @@ class MainActivity : AppCompatActivity() {
|
|||
return true
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
outState.putString("cvp", currentVideoPath)
|
||||
outState.putParcelable("cvi", currentVideoUri)
|
||||
super.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
|
||||
currentVideoPath = savedInstanceState.getString("cvp")
|
||||
currentVideoUri = savedInstanceState.getParcelable("cvi")
|
||||
super.onRestoreInstanceState(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
|
|
Reference in a new issue