override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
R.id.action_redirect -> {
Statified.myActivity?.onBackPressed()
if (Statified.mediaPlayer?.isPlaying as Boolean) {
nowPlayingBottomBar?.visibility = View.VISIBLE
} else {
nowPlayingBottomBar?.visibility = View.INVISIBLE
}
}
}
return false
}
这是Kotlin中的代码。但是当我使用action_redirect按钮向后导航时,正在播放的栏不会出现。