📜  android 全局变量 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:47.436000             🧑  作者: Mango

代码示例1
if you use Kotlin, you can just create "object"
object Singletone {
    val BASE_URL:String = "https://www.google.com/"; // put here any variable
    //that you want to access 
}

and just call it like this

baseUrl( Singletone.BASE_URL )