Commit 6dbd7477 authored by wanglei's avatar wanglei

...

parent 174fd429
package com.base.scanqr.ui.text
import android.content.ActivityNotFoundException
import android.content.Intent
import android.net.Uri
import android.os.Environment
import android.widget.Toast
import androidx.activity.addCallback
import androidx.core.view.updatePadding
import com.base.scanqr.R
......@@ -21,6 +25,7 @@ import com.base.scanqr.utils.ToastUtils.toast
import com.google.gson.Gson
import java.io.File
class TextCodeActivity : BaseActivity<ActivityTextCodeBinding>(ActivityTextCodeBinding::inflate) {
private var textUIBean = TextUIBean()
......@@ -97,7 +102,16 @@ class TextCodeActivity : BaseActivity<ActivityTextCodeBinding>(ActivityTextCodeB
toast("Copied to clipboard", true)
}
binding.flSearch.setOnClickListener {
toast("没有做")
val intent = Intent(Intent.ACTION_VIEW)
intent.setData(Uri.parse("https://www.google.com/search?q=${textUIBean.content}"))
try {
startActivity(intent)
} catch (e: ActivityNotFoundException) {
toast("")
Toast.makeText(this, "No application was found to handle the search request", Toast.LENGTH_SHORT).show()
}
}
}
......
......@@ -176,6 +176,7 @@
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<ImageView
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment