Skip to content

matteocrippa/FragmentContextivity

Repository files navigation

FragmentContextivity

A Kotlin extension for Fragment, to easy get the current context/activity supporting < 21 API

Install

Add to gradle in allprojects

maven { url 'https://jitpack.io' }

then add this

compile 'com.github.matteocrippa:FragmentContextivity:0.0.2'

Usage

FragmentContextivity provide you a new function called context(), that provides you automatically the right instance according your API.

Example:

this.context()

Error

Add this to bundle.gradle to fix app_release error

    packagingOptions {
        exclude 'META-INF/app_release.kotlin_module'
    }

About

A context/fragment instance getter with support for API < 22

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages