diff --git a/framework/src/org/apache/cordova/CordovaWebViewClient.java b/framework/src/org/apache/cordova/CordovaWebViewClient.java index e101c8b1..e3139459 100755 --- a/framework/src/org/apache/cordova/CordovaWebViewClient.java +++ b/framework/src/org/apache/cordova/CordovaWebViewClient.java @@ -203,9 +203,12 @@ public class CordovaWebViewClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { // Clear history so history.back() doesn't do anything. - // So we can reinit() native side CallbackServer & PluginManager. - view.clearHistory(); - this.doClearHistory = true; + // So we can reinit() native side CallbackServer & PluginManager.\ + if(!appView.useBrowserHistory) + { + view.clearHistory(); + this.doClearHistory = true; + } } /** diff --git a/framework/src/org/apache/cordova/DroidGap.java b/framework/src/org/apache/cordova/DroidGap.java index 21e14aa7..33499b4e 100755 --- a/framework/src/org/apache/cordova/DroidGap.java +++ b/framework/src/org/apache/cordova/DroidGap.java @@ -225,16 +225,9 @@ public class DroidGap extends Activity implements CordovaInterface { getWindow().requestFeature(Window.FEATURE_NO_TITLE); - if (preferences.prefMatches("fullscreen","true")) { - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, - WindowManager.LayoutParams.FLAG_FULLSCREEN); - } else if(preferences.prefMatches("useBrowserHistory", "true")) { - useBrowserHistory = true; - } else { - getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN, WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); - } - + // This builds the view. We could probably get away with NOT having a LinearLayout, but I like having a bucket! Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth(); @@ -283,7 +276,11 @@ public class DroidGap extends Activity implements CordovaInterface { // white list of allowed URLs // debug setting this.loadConfiguration(); - + //Now we can check the preference + appView.useBrowserHistory = preferences.prefMatches("useBrowserHistory", "true"); + + // + this.appView.setLayoutParams(new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, @@ -291,7 +288,6 @@ public class DroidGap extends Activity implements CordovaInterface { // Add web view but make it invisible while loading URL this.appView.setVisibility(View.INVISIBLE); - this.appView.useBrowserHistory = useBrowserHistory; root.addView(this.appView); setContentView(root);