Skip to content

Commit

Permalink
refactor: set fragment tag in SingleFragmentActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
BrayanDSO committed Nov 23, 2024
1 parent 965b256 commit f42fa90
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ open class SingleFragmentActivity : AnkiActivity() {
arguments = intent.getBundleExtra(FRAGMENT_ARGS_EXTRA)
}
supportFragmentManager.commit {
replace(R.id.fragment_container, fragment)
replace(R.id.fragment_container, fragment, FRAGMENT_TAG)
}
}

Expand All @@ -89,6 +89,7 @@ open class SingleFragmentActivity : AnkiActivity() {
companion object {
const val FRAGMENT_NAME_EXTRA = "fragmentName"
const val FRAGMENT_ARGS_EXTRA = "fragmentArgs"
const val FRAGMENT_TAG = "SingleFragmentActivityTag"

fun getIntent(context: Context, fragmentClass: KClass<out Fragment>, arguments: Bundle? = null, intentAction: String? = null): Intent {
return Intent(context, SingleFragmentActivity::class.java).apply {
Expand Down

0 comments on commit f42fa90

Please sign in to comment.