This commit is contained in:
Bnyro 2022-06-01 07:45:02 +02:00
parent 4531cd6def
commit 78767b35d7

View File

@ -11,17 +11,14 @@ class RouterActivity : AppCompatActivity() {
val TAG = "RouterActivity"
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Check if Intent Action is ACTION_SEND
if (intent?.action == Intent.ACTION_SEND) {
if (intent.type == "text/plain" && checkHost(intent)) {
if (checkHost(intent)) {
// start the main activity using the given URI as data if the host is known
handleSendText(intent)
} else {
// start app as normal if wrong intent type
// start app as normal if URI not in host list
restartMainActivity(this)
}
}
}
private fun checkHost(intent: Intent): Boolean {
// check whether the host is known, current solution to replace the broken intent filter