WebView打开页面,但我无法采取任何措施

时间:2020-06-16 15:25:00

标签: android webview android-webview

我正在使用advancedWebView库(https://github.com/delight-im/Android-AdvancedWebView),页面正在加载,但是我无法对页面执行任何操作,下面是我的代码,

public class AdvancedWebViewActivity extends AppCompatActivity implements AdvancedWebView.Listener {

private AdvancedWebView mWebView;
private static final String TAG = "AdvancedWebViewActivity";

@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_advanced_web_view);

    Intent intent = getIntent();
    String url = intent.getStringExtra("gameUrl");

    mWebView = findViewById(R.id.webView);
    mWebView.setListener(this, this);
    mWebView.getSettings().setJavaScriptEnabled(true);
    mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
    mWebView.getSettings().setBuiltInZoomControls(true);
    mWebView.getSettings().setDomStorageEnabled(true);
    mWebView.getSettings().setAllowFileAccess(true);
    mWebView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
    mWebView.loadUrl(url);
}


// default codes

}

0 个答案:

没有答案