1

I am developing an android application in which I want to show a website, which have links in it. When any link is clicked, then it plays an online stream.

Till now I have developed an app which work alright. In this I have used webview to display first screen. The live stream is not supported in webview, so I used webchromeclient.

Now the problem is when any link is clicked, a new browser opens and plays the stream and also shows the address bar and address of page loaded page.

I want to hide the address of new loaded page. and if possible, also I wnt to keep webchromeclient in existing screen, not a new browser.

4

1 に答える 1

1

この場合、このWebViewClientようにカスタマイズする必要があります

private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {

        // This is my web site, so do not override; let my WebView load the page
        return true;
    }
  }
}

次に、WebView のこの新しい WebViewClient のインスタンスを作成します。

WebView myWebView = (WebView) findViewById(R.id.webview);
myWebView.setWebViewClient(new MyWebViewClient());

さらにこれを見て、注意深く読んでください

于 2013-11-12T19:20:17.913 に答える