Skip to content

Instantly share code, notes, and snippets.

@vamjakuldip
Created January 24, 2020 04:27
Show Gist options
  • Save vamjakuldip/f18c989ce1befea265bcc4d4495036cc to your computer and use it in GitHub Desktop.
Save vamjakuldip/f18c989ce1befea265bcc4d4495036cc to your computer and use it in GitHub Desktop.
Application Context with Multidex install
package com.vk.android.utils
import android.app.Application
import android.content.Context
import androidx.multidex.MultiDex
class VkApplication : Application() {
private val TAG = this.javaClass.simpleName
override fun onCreate() {
super.onCreate()
context = this
}
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
MultiDex.install(base)
}
companion object {
lateinit var context: Context
private set
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment