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

View File

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