Skip to content

Commit

Permalink
Use payload as string or the name
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonfournier committed Jul 19, 2024
1 parent 29e31e5 commit e9c5f10
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class FirstFragment : Fragment() {
binding.buttonFirst.setOnClickListener {
if (unleashClient.isEnabled("android-sdk-first-fragment-demo")) {
val bundle = Bundle()
bundle.putString("argName", unleashClient.getVariant("android-sdk-first-fragment-demo").name)
val variant = unleashClient.getVariant("android-sdk-first-fragment-demo")
bundle.putString("argName", variant.payload?.getValueAsString() ?: variant.name)
findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment, bundle)
}
}
Expand Down

0 comments on commit e9c5f10

Please sign in to comment.