- Oct 13, 2016
- 4
- 0
- 0
I found an app's source code and the first page when you open the app, it opens the page from gooogle chrome or any other browser but I want when someone open the app to open specific page, it should open in the app not external . I think this below I should change somehow
private class MyWebviewClient extends WebViewClient {
@override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (Uri.parse(url).getHost().equals("http://dmc.teiion.gr")) {
//open url contents in webview
return false;
} else {
//here open external links in external browser or app
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
private class MyWebviewClient extends WebViewClient {
@override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (Uri.parse(url).getHost().equals("http://dmc.teiion.gr")) {
//open url contents in webview
return false;
} else {
//here open external links in external browser or app
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}