我是Kotlin的新手,我正在尝试开发一个音乐应用程序.
我收到了这个我无法解决的错误.当我打开我的应用程序时,会显示歌曲列表,点击一首歌曲,它会重定向到现在播放的屏幕,但点击下一个或上一个按钮,我的应用程序崩溃了.
logcat给出了一个我不明白的TypeCast错误.
守则如下:
class SongPlayingFragment : Fragment() {
var myActivity: Activity? = null
var mediaplayer: MediaPlayer? = null
var startTimeText: TextView? = null
var endTimeText: TextView? = null
var playpauseImageButton: ImageButton? = null
var previousImageButton: ImageButton? = null
var nextImageButton: ImageButton? = null
var loopImageButton: ImageButton? = null
var seekbar: SeekBar? = null
var songArtistView: TextView? = null
var songTitleView: TextView? = null
var shuffleImageButton: ImageButton? = null
var currentPosition: Int = 0
var fetchSongs: ArrayList<Songs>? = null
var …
Run Code Online (Sandbox Code Playgroud)