From 59508a45cb440bae1a067febc740531ddd4d3223 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Mon, 24 Apr 2023 17:00:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B2=89=E4=B8=9D=E5=BE=BD?= =?UTF-8?q?=E7=AB=A0=E5=B8=AE=E5=8A=A9=E6=8C=89=E9=92=AE=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=B2=A1=E5=8F=8D=E5=BA=94=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/MedalQuestionWebViewActivity.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java b/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java index 1db2d7681..6d0be362a 100644 --- a/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/MedalQuestionWebViewActivity.java @@ -7,7 +7,9 @@ import android.content.Intent; import android.net.Uri; import android.os.Build; import android.provider.MediaStore; + import androidx.annotation.RequiresApi; + import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; @@ -41,6 +43,7 @@ public class MedalQuestionWebViewActivity extends AbsActivity { private final int CHOOSE_ANDROID_5 = 200;//Android 5.0以上的 private ValueCallback mValueCallback; private ValueCallback mValueCallback2; + @Override protected int getLayoutId() { return R.layout.activity_webview; @@ -50,14 +53,13 @@ public class MedalQuestionWebViewActivity extends AbsActivity { protected void main() { String url = getIntent().getStringExtra(Constants.URL); L.e("H5---2>" + url); - LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); + // LinearLayout rootView = (LinearLayout) findViewById(R.id.rootView); mProgressBar = (ProgressBar) findViewById(R.id.progressbar); - mWebView = new WebView(mContext); - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); - params.topMargin = DpUtil.dp2px(1); - mWebView.setLayoutParams(params); - mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); - rootView.addView(mWebView); + mWebView = findViewById(R.id.webView); + // LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); + // params.topMargin = DpUtil.dp2px(1); + // mWebView.setLayoutParams(params); + // mWebView.setOverScrollMode(View.OVER_SCROLL_NEVER); mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { @@ -123,6 +125,7 @@ public class MedalQuestionWebViewActivity extends AbsActivity { } mWebView.loadUrl(url); } + private void openImageChooserActivity(ValueCallback valueCallback) { mValueCallback = valueCallback; Intent intent = new Intent();