Created
December 16, 2020 14:40
-
-
Save tpakis/88d0486270cde5622b9f71d9e01d142d to your computer and use it in GitHub Desktop.
Intended use of bindview in activity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private val buttonBaseline: Button by bindView(R.id.button_go_to_baseline) | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
buttonBaseline.setOnClickListener { | |
goToABTest(ABTestVariation.BASELINE) | |
} | |
} | |
private fun goToABTest(variation: ABTestVariation) { | |
ABTestActivity.startInABTestVariation(this, variation) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment