03-07-2013 11:50 AM
Ok thanks for your reply, that could be a temp fix for this issue.
Can you explain a bit more with a code sample how you detect the error to reload the webview ?
Regards,
Antoine
03-07-2013 02:11 PM
I have a custom WebChromeClient:
public class MyWebChromeClient extends WebChromeClient
{
// Other methods implemented as needed
@Override
public boolean onConsoleMessage( ConsoleMessage message)
{
if ( message == null )
{
return super.onConsoleMessage( message );
}
String messageString = message.message();
if ( messageString != null )
{
if ( messageString.contains( "Uncaught TypeError" ) )
{
if ( this.mCallback != null )
{
this.mCallback.blackBerry10Error();
}
}
}
}
}
mCallback is a special interface that the fragment implements that allows it to register to the custom WebChromeClient. Implementation of this is straightforward. The final piece is in the blackBerry10Error method in the fragment:
@Override
public void blackBerry10Error()
{
if ( this.mWebView != null )
{
this.mWebView.reload();
}
}
As I said, very hackish, but it gets the webview to keep reloading until it actually gets it right.
03-11-2013 04:19 AM
Thanks guys, it works pretty fine.
Regards,
Nishant Shah
yesterday
hello,
I am porting an existing android application on the new backberry 10 OS , I am stucked by the google map,I want to add multiple markers on the google map, and add click event on the marker,I have tried to use the google map JavaScript V3 in the app, the app crashed when run on the blackberry 10 device,but it is normal when run on the android 2.3 and up.I need your help,look forward to your reply.