Skip to content

Instantly share code, notes, and snippets.

@KaustubhPatange
Last active November 23, 2021 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaustubhPatange/33c60c41e5ba33ba23122132cb2aa218 to your computer and use it in GitHub Desktop.
Save KaustubhPatange/33c60c41e5ba33ba23122132cb2aa218 to your computer and use it in GitHub Desktop.
// implement the interface in the :app module
class WelcomeButtonClickImpl @Inject constructor(
private val activity: FragmentActivity /* Provides the nearest fragment activity */
) : WelcomeButtonClick {
override fun goToNext() {
activity.supportFragmentManager.beginTransaction()
.addToBackStack("home")
.replace(R.id.frag_container, HomeFragment::class.java, null)
.commit()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment