Skip to content

Commit

Permalink
【ID869532311】App数据隐私合规检测风险问题修复-解决webview无法下载问题
Browse files Browse the repository at this point in the history
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192869532311

Change-Id: Iaf09a02b3771308fc8b946621e2447c31de4a13b
  • Loading branch information
SundoggyNew committed Nov 29, 2021
1 parent 0c27b65 commit 6f481ff
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.tencent.iot.explorer.link.kitlink.activity

import android.content.Intent
import android.net.Uri
import android.view.View
import android.view.ViewGroup
import android.webkit.*
Expand Down Expand Up @@ -73,6 +74,12 @@ class WebActivity : BaseActivity() {
wv_web.visibility = View.VISIBLE
sv_help.visibility = View.GONE
wv_web.loadUrl(url)
wv_web.setDownloadListener(myDownloadListener)
}
private val myDownloadListener = DownloadListener { url, _, _, _, _ ->
val uri: Uri = Uri.parse(url)
val intent = Intent(Intent.ACTION_VIEW, uri)
startActivity(intent)
}

override fun setListener() {
Expand Down

0 comments on commit 6f481ff

Please sign in to comment.