How to set global variable in Ko
2018-01-24 本文已影响19人
yingshaoxo
- 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