[TIMOB-4474] WebView goBack() method doesn't work for local files
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Trivial |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-03-21T00:58:00.000+0000 |
Affected Version/s | Release 1.7.0, Release 1.6.2 |
Fix Version/s | Release 3.0.2 |
Components | Android |
Labels | andoid, look1, webview |
Reporter | Eduardo Gomez |
Assignee | Max Stepanov |
Created | 2011-06-21T14:36:46.000+0000 |
Updated | 2017-03-20T17:00:41.000+0000 |
Description
There is a HD ticket having this problem, where goBack() method doesn't work when local files are referenced in "url" property of a WebView,
http://support.appcelerator.com/display/APP-327395
Repro sequence:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
webview = Ti.UI.createWebView({id:'webview',
url:'home.html',
top:100,
canGoBack:true
});
win_home.add(webview);
win_home.addEventListener('android:back',function(){
webview.goBack();
});
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work around for it:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
win1.addEventListener('android:back',function(){
myWebView.url = 'index.html'; //Set file
});
myWebView.reload(); //reload WebView
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Closing ticket as fixed.