Skip to content

Commit 6f481ff

Browse files
committed
【ID869532311】App数据隐私合规检测风险问题修复-解决webview无法下载问题
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192869532311 Change-Id: Iaf09a02b3771308fc8b946621e2447c31de4a13b
1 parent 0c27b65 commit 6f481ff

File tree

1 file changed

+7
-0
lines changed
  • app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity

1 file changed

+7
-0
lines changed

app/src/main/java/com/tencent/iot/explorer/link/kitlink/activity/WebActivity.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.tencent.iot.explorer.link.kitlink.activity
22

33
import android.content.Intent
4+
import android.net.Uri
45
import android.view.View
56
import android.view.ViewGroup
67
import android.webkit.*
@@ -73,6 +74,12 @@ class WebActivity : BaseActivity() {
7374
wv_web.visibility = View.VISIBLE
7475
sv_help.visibility = View.GONE
7576
wv_web.loadUrl(url)
77+
wv_web.setDownloadListener(myDownloadListener)
78+
}
79+
private val myDownloadListener = DownloadListener { url, _, _, _, _ ->
80+
val uri: Uri = Uri.parse(url)
81+
val intent = Intent(Intent.ACTION_VIEW, uri)
82+
startActivity(intent)
7683
}
7784

7885
override fun setListener() {

0 commit comments

Comments
 (0)