Issue
I am developing an app that is similar to a web browser. Now when i click on an email address in a web page displayed thru a WebView, this is what happens :
- A set of email clients for me to choose from are displayed
- The webview tries to load the url, "mailto:[email protected]" and displays the error page when it cannot find the url.
I am trying to figure out how to solve the problem in No.2.
Basically, i do not need the app to load the url that contains a 'mailto:'.
Here's what i have tried to do but failed:
under 'shouldOverrideUrlLoading()',
if( url.startsWith("mailto") ) { /*Do the stuff for sending email but i will not display */ url = null; }
Before the view.loadurl(url), Added a
if( !url.startsWith("mailto:") ) view.loadurl(url);
I know these are hacks and are not very elegant. Hence, can someone point me in the right path ?
Thank you.
Solution
Try with using return true;
in shouldOverrideUrlLoading()
method. :)
Answered By - Ravi Bhatt
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.