Skip to content

Instantly share code, notes, and snippets.

@KatieBarnett
Created March 19, 2023 03:55
Show Gist options
  • Save KatieBarnett/be9875de29908a2c42d3b86c44a027d6 to your computer and use it in GitHub Desktop.
Save KatieBarnett/be9875de29908a2c42d3b86c44a027d6 to your computer and use it in GitHub Desktop.
Wear OS inout multi capturing results
val launcher = rememberLauncherForActivityResult(
ActivityResultContracts.StartActivityForResult()
) {
it.data?.let { data ->
val results: Bundle = RemoteInput.getResultsFromIntent(data)
val newInputText1: CharSequence = results.getCharSequence(inputTextKey1) ?: ""
val newInputText2: CharSequence = results.getCharSequence(inputTextKey2) ?: ""
val newInputText3: CharSequence = results.getCharSequence(inputTextKey3) ?: ""
userInput = "$newInputText1 $newInputText2 and $newInputText3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment