mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
fix
This commit is contained in:
parent
4531cd6def
commit
78767b35d7
@ -11,17 +11,14 @@ 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) {
|
|
||||||
if (intent.type == "text/plain" && checkHost(intent)) {
|
|
||||||
// start the main activity using the given URI as data if the host is known
|
// start the main activity using the given URI as data if the host is known
|
||||||
handleSendText(intent)
|
handleSendText(intent)
|
||||||
} else {
|
} else {
|
||||||
// start app as normal if wrong intent type
|
// start app as normal if URI not in host list
|
||||||
restartMainActivity(this)
|
restartMainActivity(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun checkHost(intent: Intent): Boolean {
|
private fun checkHost(intent: Intent): Boolean {
|
||||||
// check whether the host is known, current solution to replace the broken intent filter
|
// check whether the host is known, current solution to replace the broken intent filter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user