You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
611 B
Kotlin

package com.common.commonlib
import android.annotation.SuppressLint
import android.app.Application
import android.content.Context
/**
* 基础Application
*
* @author wangym
* @since 2021/7/28
*/
@SuppressLint("StaticFieldLeak")
open class CommonApplication : Application() {
override fun onCreate() {
super.onCreate()
intLibs(this)
}
private fun intLibs(context: Context) {
commonContext = context
}
companion object {
private var commonContext: Context? = null
fun getContext(): Context? {
return commonContext
}
}
}