第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Webview 不適用于 HTML 選擇元素

Webview 不適用于 HTML 選擇元素

喵喵時光機 2022-07-14 17:27:58
所以我的 webview 不能使用 select 元素。換句話說,當我單擊任何頁面上的選擇元素時,它不會顯示菜單。html 選擇元素示例:<select>    <option>test</option>    <option>testing it</option>    <option>bla bla bla</option></select>java創(chuàng)建我的webview:        NestedWebView nwv = new NestedWebView(activity.getApplicationContext());    nwv.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));    registerForContextMenu(nwv);    nwv.setWebViewClient(new webViewClient());    nwv.setWebChromeClient(new webChromeClient(nwv));    nwv.addJavascriptInterface(new JSInterface(), "drconsole");    nwv.getSettings().setJavaScriptEnabled(true);    nwv.getSettings().setLoadWithOverviewMode(true);    nwv.getSettings().setUseWideViewPort(true);    nwv.getSettings().setSupportZoom(true);    nwv.getSettings().setBuiltInZoomControls(true);    nwv.getSettings().setDisplayZoomControls(false);    nwv.getSettings().setAllowFileAccess(true);    nwv.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);    nwv.getSettings().setSupportMultipleWindows(true);    nwv.getSettings().setGeolocationEnabled(true);    nwv.setDrawingCacheEnabled(true);    nwv.getSettings().setPluginState(WebSettings.PluginState.ON);    nwv.loadUrl(url);    nwv.setDownloadListener(new DownloadListener(){        @Override        public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength){            try{                DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));                String filename = new URL(url).getFile();                request.allowScanningByMediaScanner();                request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);                request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, filename.substring(filename.lastIndexOf('/')+1));            }        }    });我也幾乎可以使用 webviewclient 和 webchromeclient 。請在對我的問題投票之前發(fā)表評論。
查看完整描述

1 回答

?
MYYA

TA貢獻1868條經驗 獲得超4個贊

要修復此錯誤,必須使用活動而不是應用程序上下文來初始化 webview。

這一行:

NestedWebView nwv = new NestedWebView(activity.getApplicationContext());

一定是:

NestedWebView nwv = new NestedWebView(activity);


查看完整回答
反對 回復 2022-07-14
  • 1 回答
  • 0 關注
  • 128 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號