hello friends,
i am using webview in my app and using local html pages(from the assets folder).
generally it is working fine, but in devices with utorrent installed, utorrent app is being open, i am getting some bad ratings because of this.
i found a solution to this -
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// Check if the key event was the Back button and if there’s history
if ((keyCode == KeyEvent.KEYCODE_BACK) && wv.canGoBack()) {
wv.goBack();
return(true);
}
return super.onKeyDown(keyCode, event);
}
i am using this…will this work fine with the above code for utorrent problem?
That’s very strange then because I use this exact code and the goBack() never skips a page. However, using javascript redirects in your html WILL screw it all up.
There is a solution that should work every time using onPageFinished() and keeping a list of visited urls, although you shouldn’t have to. The code is here: