Skip to content

Instantly share code, notes, and snippets.

@mayuce
Created November 7, 2020 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mayuce/1f90ca4e7c03b38af70f2e63c3ca22ed to your computer and use it in GitHub Desktop.
Save mayuce/1f90ca4e7c03b38af70f2e63c3ca22ed to your computer and use it in GitHub Desktop.
package com.some.package.ui.splash.presentation
import ....
class SplashActivity :
BaseActivity<*, *>() {
companion object {
private const val DEEP_LINK_FUNCTION_ID = "functionId"
}
override fun onCreate() {
super.onCreate()
// ---- SOME CODE
route()
}
private fun route() {
intent.data?.getQueryParameter(DEEP_LINK_FUNCTION_ID)?.toIntOrNull()?.let {
Router.routeToLink(this@SplashActivity, it, intent.data)
} ?: kotlin.run {
MovieDetailRouter.startActivity(
this@SplashActivity,
RouteDetailRouter.RouterData(-1)
)
}
finish()
}
// ---- SOME CODE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment