|
|
@ -3,7 +3,6 @@ package io.legado.app.receiver |
|
|
|
import android.content.Intent |
|
|
|
import android.content.Intent |
|
|
|
import android.os.Build |
|
|
|
import android.os.Build |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.PersistableBundle |
|
|
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity |
|
|
|
import androidx.appcompat.app.AppCompatActivity |
|
|
|
import io.legado.app.ui.book.search.SearchActivity |
|
|
|
import io.legado.app.ui.book.search.SearchActivity |
|
|
|
import io.legado.app.ui.main.MainActivity |
|
|
|
import io.legado.app.ui.main.MainActivity |
|
|
@ -13,8 +12,8 @@ class SharedReceiverActivity : AppCompatActivity() { |
|
|
|
|
|
|
|
|
|
|
|
private val receivingType = "text/plain" |
|
|
|
private val receivingType = "text/plain" |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) { |
|
|
|
override fun onCreate(savedInstanceState: Bundle?) { |
|
|
|
super.onCreate(savedInstanceState, persistentState) |
|
|
|
super.onCreate(savedInstanceState) |
|
|
|
initIntent() |
|
|
|
initIntent() |
|
|
|
finish() |
|
|
|
finish() |
|
|
|
} |
|
|
|
} |
|
|
@ -25,7 +24,6 @@ class SharedReceiverActivity : AppCompatActivity() { |
|
|
|
if (openUrl(it)) { |
|
|
|
if (openUrl(it)) { |
|
|
|
startActivity<SearchActivity>(Pair("key", it)) |
|
|
|
startActivity<SearchActivity>(Pair("key", it)) |
|
|
|
} |
|
|
|
} |
|
|
|
finish() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M |
|
|
|
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M |
|
|
|
&& Intent.ACTION_PROCESS_TEXT == intent.action |
|
|
|
&& Intent.ACTION_PROCESS_TEXT == intent.action |
|
|
@ -35,7 +33,6 @@ class SharedReceiverActivity : AppCompatActivity() { |
|
|
|
if (openUrl(it)) { |
|
|
|
if (openUrl(it)) { |
|
|
|
startActivity<SearchActivity>(Pair("key", it)) |
|
|
|
startActivity<SearchActivity>(Pair("key", it)) |
|
|
|
} |
|
|
|
} |
|
|
|
finish() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|