SJSSoft
SJSSoft

Reputation: 743

Is there a way to hide addressbar in webchromeclient?

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.

Upvotes: 1

Views: 1381

Answers (1)

Qadir Hussain
Qadir Hussain

Reputation: 8856

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

Upvotes: 1

Related Questions