fix: 修复闪退
This commit is contained in:
parent
3c3688b716
commit
6b3ecf37da
|
|
@ -145,11 +145,12 @@ class BaseApplication : Application(), IApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onActivityResumed(activity: Activity) {
|
override fun onActivityResumed(activity: Activity) {
|
||||||
if (clipBoardHash != getClipBoardHash()) {
|
val clipBoardText = clipBoard
|
||||||
|
if (clipBoardHash != getClipBoardHash() && clipBoardText != null) {
|
||||||
@RegExp val regex =
|
@RegExp val regex =
|
||||||
"((http|https)://)(([a-zA-Z0-9._-]+\\.[a-zA-Z]{2,6})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,4})*(/[a-zA-Z0-9&%_./-~-]*)?"
|
"((http|https)://)(([a-zA-Z0-9._-]+\\.[a-zA-Z]{2,6})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,4})*(/[a-zA-Z0-9&%_./-~-]*)?"
|
||||||
val pattern = Pattern.compile(regex)
|
val pattern = Pattern.compile(regex)
|
||||||
val matcher = pattern.matcher(clipBoard)
|
val matcher = pattern.matcher(clipBoardText)
|
||||||
if (matcher.find()) {
|
if (matcher.find()) {
|
||||||
val url = matcher.group()
|
val url = matcher.group()
|
||||||
val uri = Uri.parse(url)
|
val uri = Uri.parse(url)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue