A Kotlin extension for Fragment, to easy get the current context/activity supporting < 21 API
Add to gradle in allprojects
maven { url 'https://jitpack.io' }
then add this
compile 'com.github.matteocrippa:FragmentContextivity:0.0.2'
FragmentContextivity
provide you a new function called context()
, that provides you automatically the right instance according your API.
Example:
this.context()
Add this to bundle.gradle
to fix app_release error
packagingOptions {
exclude 'META-INF/app_release.kotlin_module'
}