changed back button behavior to use the native way to test if a webview can go back

This commit is contained in:
Jan Monschke 2010-08-23 15:35:56 +02:00
parent ac952b25bb
commit 27ff3068f5

View File

@ -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);
}