catch and show exceptions thrown at fetching path of MediaActivity
This commit is contained in:
parent
0a752cea03
commit
8effeedd7d
1 changed files with 8 additions and 1 deletions
|
@ -81,7 +81,14 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
media_refresh_layout.setOnRefreshListener { getMedia() }
|
media_refresh_layout.setOnRefreshListener { getMedia() }
|
||||||
mPath = intent.getStringExtra(DIRECTORY)
|
try {
|
||||||
|
mPath = intent.getStringExtra(DIRECTORY)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
|
finish()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
storeStateVariables()
|
storeStateVariables()
|
||||||
if (mShowAll)
|
if (mShowAll)
|
||||||
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
supportActionBar?.setDisplayHomeAsUpEnabled(false)
|
||||||
|
|
Loading…
Reference in a new issue