Skip to content

Instantly share code, notes, and snippets.

@AndroidPoet
Created April 17, 2026 17:28
Show Gist options
  • Select an option

  • Save AndroidPoet/67424c81ca5bd2476358e0bd8d66d9f1 to your computer and use it in GitHub Desktop.

Select an option

Save AndroidPoet/67424c81ca5bd2476358e0bd8d66d9f1 to your computer and use it in GitHub Desktop.
fun parseDeepLink(link: String): Route? {
return try {
when {
link.contains("/article/") -> Route.Article(link.substringAfterLast("/"))
else -> null
}
} catch (e: Exception) {
Log.e("DeepLink", "Failed to parse", e)
null
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment