|
|
|
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")
|
|
|
|
object CommonApplication : Application() {
|
|
|
|
private var commonContext: Context? = null
|
|
|
|
|
|
|
|
override fun onCreate() {
|
|
|
|
super.onCreate()
|
|
|
|
intLibs(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
fun intLibs(context: Context) {
|
|
|
|
commonContext = context
|
|
|
|
}
|
|
|
|
|
|
|
|
fun getContext(): Context? {
|
|
|
|
return commonContext
|
|
|
|
}
|
|
|
|
}
|