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();