Skip to content

Instantly share code, notes, and snippets.

@MartuPuri
Created October 12, 2017 19:50
Show Gist options
  • Save MartuPuri/0f4e9addbccdef2e5ff74d0b0b79f3a0 to your computer and use it in GitHub Desktop.
Save MartuPuri/0f4e9addbccdef2e5ff74d0b0b79f3a0 to your computer and use it in GitHub Desktop.
Base Android Project - BaseFragmentActivity
abstract class BaseFragmentActivity : AppCompatActivity() {
private var unbinder: Unbinder? = null
@get:LayoutRes protected abstract val contentView: Int
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(contentView)
unbinder = ButterKnife.bind(this)
}
override fun onDestroy() {
unbinder?.unbind()
super.onDestroy()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment