Skip to content

Instantly share code, notes, and snippets.

@markchristopherng
Created October 15, 2019 00:10
Show Gist options
  • Save markchristopherng/d21ed0840d6b7de80f8ce1475714d35e to your computer and use it in GitHub Desktop.
Save markchristopherng/d21ed0840d6b7de80f8ce1475714d35e to your computer and use it in GitHub Desktop.
abstract class BaseActivity(@LayoutRes contentLayoutId: Int) : AppCompatActivity(contentLayoutId) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
getScope().supportScopeAnnotation(ActivityScope::class.java)
.installModules(ActivityModule(this))
.closeOnDestroy(this)
.inject(this)
}
open fun getScope(): Scope {
return KTP.openRootScope()
.openSubScope(AppConsants.APPSCOPE)
.openSubScope(this)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment