Android 4.4;使用Intent打开Chrome Webapp

时间:2014-05-23 07:30:04

标签: android webrtc google-chrome-app

我正在尝试在我的应用中使用WebRTC实现网页。由于4.4 WebView仍然不支持WebRTC,我试图找到另一种方法来使用WebRTC功能以全屏方式打开全屏网页。

我是否可以使用#34; WebApp" -mode打开Chrome?

1 个答案:

答案 0 :(得分:1)

尝试这个

webView.setWebViewClient(new MyWebClient());
webView.loadUrl(webViewUrl);

MyWebClient.java

public class MyWebClient extends WebViewClient {
    @Override
    /**
     * Notify the host application that a page has started loading.
     */
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        super.onPageStarted(view, url, favicon);
    }

    @Override
    /**
     * Give the host application a chance to take over the control when a new url is about to be loaded in the current WebView.
     */
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        @SuppressWarnings("unused")
        Uri uri = Uri.parse(url);
        // Intent intent = new Intent(Intent.ACTION_VIEW, uri);
        // startActivity(intent);
        view.loadUrl(url);
        return true;
    }

    @Override
    /**
     * Notify the host application that a page has finished loading.
     */
    public void onPageFinished(WebView view, String url) {
        super.onPageFinished(view, url);

    }
}