簡體   English   中英

Android 4.4; 使用Intent打開Chrome Webapp

[英]Android 4.4; Open Chrome Webapp with Intent

我正在嘗試在我的應用中使用WebRTC實施網頁。 由於4.4 WebView仍然不支持WebRTC,因此我試圖找到另一種方法來使用具有WebRTC功能的全屏chrome打開網頁。

是否可以在“ WebApp”模式下打開Chrome?

試試這個

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

    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM