Ellen Spertus
02/21/2020, 12:15 AMprivate fun createSearchIntent(mr: MatcherResult) =
mr.slots[THING_KEY]?.let { thing ->
val suffix = mr.slots[LOCATION_KEY]?.let { "in $it" } ?: ""
Intent(
Intent.ACTION_VIEW,
Uri.parse("navigation:q=$thing$suffix")
)
}
Can Orhan
02/24/2020, 2:54 PM$thing$suffix
suggests you don’t want white space 🙂Ellen Spertus
02/24/2020, 10:54 PM"in it"
. (All the spaces will be handled by Uri.parse()
.) Thanks for pointing that out!