mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +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
|
else
|
||||||
{
|
{
|
||||||
String testUrl = appView.getUrl();
|
// only go back if the webview tells you that it is possible to go back
|
||||||
appView.goBack();
|
if(appView.canGoBack())
|
||||||
if(appView.getUrl().equals(testUrl))
|
{
|
||||||
|
appView.goBack();
|
||||||
|
}
|
||||||
|
else // if you can't go back, invoke behavior of super class
|
||||||
{
|
{
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user