Skip to content

Instantly share code, notes, and snippets.

@virendersran01
Forked from mayuce/SplashActivity.kt
Created April 9, 2021 04:25
Show Gist options
  • Select an option

  • Save virendersran01/d964a356c5ea7a1ce0837bb468886116 to your computer and use it in GitHub Desktop.

Select an option

Save virendersran01/d964a356c5ea7a1ce0837bb468886116 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