- put this on top:
object GlobalVariable {
var mp = MediaPlayer()
}
-
use it everywhere
GlobalVariable.mp
-
so you won't have to worry about open too many MediaPlayer at the same time
object GlobalVariable {
var mp = MediaPlayer()
}
use it everywhere
GlobalVariable.mp
so you won't have to worry about open too many MediaPlayer at the same time
本文标题:How to set global variable in Ko
本文链接:https://www.haomeiwen.com/subject/jugpaxtx.html
网友评论