moving a function at the top
This commit is contained in:
parent
6f427b6ca1
commit
835559403a
1 changed files with 12 additions and 12 deletions
|
@ -189,6 +189,18 @@ class TracksActivity : SimpleActivity() {
|
|||
bus?.unregister(this)
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, resultData)
|
||||
if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||
try {
|
||||
val outputStream = contentResolver.openOutputStream(resultData.data!!)
|
||||
exportPlaylistTo(outputStream)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun refreshMenuItems() {
|
||||
tracks_toolbar.menu.apply {
|
||||
findItem(R.id.search).isVisible = tracksType != TYPE_ALBUM
|
||||
|
@ -395,18 +407,6 @@ class TracksActivity : SimpleActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, resultData)
|
||||
if (requestCode == PICK_EXPORT_FILE_INTENT && resultCode == Activity.RESULT_OK && resultData != null && resultData.data != null) {
|
||||
try {
|
||||
val outputStream = contentResolver.openOutputStream(resultData.data!!)
|
||||
exportPlaylistTo(outputStream)
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun exportPlaylistTo(outputStream: OutputStream?) {
|
||||
val tracks = (tracks_list.adapter as TracksAdapter).tracks
|
||||
|
||||
|
|
Loading…
Reference in a new issue