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.

SJSSoft
  • 723
  • 2
  • 10
  • 28

1 Answers1

1

in this case you have to customize the WebViewClient like this

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

Then create an instance of this new WebViewClient for the WebView:

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

for further have a look on this, and read carefully

Qadir Hussain
  • 8,721
  • 13
  • 89
  • 124
  • webview does not support .m3u8 based video streaming, but webchromeclient plays it fine. So, it is must for me to open link using webchromeclient. :( – SJSSoft Nov 12 '13 at 19:31