Created
March 19, 2020 17:27
-
-
Save plnice/6c5230f58a62c259dceb990f539db3a7 to your computer and use it in GitHub Desktop.
Simple call using Activity Results APIs
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 MyActivity : AppCompatActivity() { | |
private val myActionCall = prepareCall(MyContract()) { result -> | |
Log.i("MyActivity", "Obtained result: $result") | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
... | |
button.setOnClickListener { | |
myActionCall(500) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment