Hi
i have a webview application that i am developing a solution to an https error i have.
I know that WebView dont support HTTPS but the normal android browser dose work so i started to work on the idea of it opening the https page in the browser then after people could go back to the application.
so far i found the following code that detects the website link and only allows this url to work.
So why not reverse the detection to
so if someone knows how to make that url to then open up in a new website window then it would work perfect so then it detects anything conntaining https and opens it up in a new window.
Thanks ryan
i have a webview application that i am developing a solution to an https error i have.
I know that WebView dont support HTTPS but the normal android browser dose work so i started to work on the idea of it opening the https page in the browser then after people could go back to the application.
so far i found the following code that detects the website link and only allows this url to work.
Code:
lass MyWebViewClient extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// Check if page is trying to connect to an https page
if (Uri.parse(url).getHost().equals("http://example.com")){
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
private void startActivity(Intent intent) {
// TODO Auto-generated method stub
}
}
So why not reverse the detection to
Code:
lass MyWebViewClient extends WebViewClient {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// Check if page is trying to connect to an https page
if (Uri.parse(url).getHost().contains("https://")){
// run code if detected
// This is where i need help with a popup code
return false;
}
//run code if not detected
return true;
}
private void startActivity(Intent intent) {
// TODO Auto-generated method stub
}
}
so if someone knows how to make that url to then open up in a new website window then it would work perfect so then it detects anything conntaining https and opens it up in a new window.
Thanks ryan