Skip to content

Instantly share code, notes, and snippets.

@premnirmal
Last active July 20, 2018 03:20
Show Gist options
  • Save premnirmal/45890fffdb07beb144b2c3edf159a324 to your computer and use it in GitHub Desktop.
Save premnirmal/45890fffdb07beb144b2c3edf159a324 to your computer and use it in GitHub Desktop.
class BrowseRecipesFragment : Fragment(), View.OnClickListener {
private val recipeClickListener: RecipeClickListener by ParentActivityDelegate(this)
...
override fun onClick(v: View) {
// Guaranteed to be not null :)
recipeClickListener.onRecipeClicked(recipe)
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment