mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
changed back button behavior to use the native way to test if a webview can go back
This commit is contained in:
parent
ac952b25bb
commit
27ff3068f5
@ -286,9 +286,12 @@ public class DroidGap extends Activity {
|
||||
}
|
||||
else
|
||||
{
|
||||
String testUrl = appView.getUrl();
|
||||
appView.goBack();
|
||||
if(appView.getUrl().equals(testUrl))
|
||||
// only go back if the webview tells you that it is possible to go back
|
||||
if(appView.canGoBack())
|
||||
{
|
||||
appView.goBack();
|
||||
}
|
||||
else // if you can't go back, invoke behavior of super class
|
||||
{
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user