Created
October 28, 2021 09:02
-
-
Save anangkur/0a2b44bfe586ba6eeecc40e6a82aba5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
companion object { | |
const val QUERY_COMPONENT = "component" | |
const val COMPONENT_BUTTON = "button" | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
... | |
handleIntent(intent.data?.getQueryParameter(QUERY_COMPONENT)) | |
} | |
private fun handleIntent(component: String?) { | |
when (component) { | |
COMPONENT_BUTTON -> startActivity(Intent(this, ButtonActivity::class.java)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment