cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [19/34] git commit: Use webView.loadUrlIntoView() for reload instead of window.location
Date Tue, 06 May 2014 19:29:33 GMT
Use webView.loadUrlIntoView() for reload instead of window.location


Project: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/commit/cdd39e24
Tree: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/tree/cdd39e24
Diff: http://git-wip-us.apache.org/repos/asf/cordova-app-harness/diff/cdd39e24

Branch: refs/heads/master
Commit: cdd39e246894371a7a45b802dd238c6cf225a11d
Parents: 7454e2f
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Mar 18 16:28:11 2014 -0700
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Mar 20 14:22:03 2014 -0700

----------------------------------------------------------------------
 harness-push/src/android/Push.java | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-app-harness/blob/cdd39e24/harness-push/src/android/Push.java
----------------------------------------------------------------------
diff --git a/harness-push/src/android/Push.java b/harness-push/src/android/Push.java
index b216a14..1ac04b1 100644
--- a/harness-push/src/android/Push.java
+++ b/harness-push/src/android/Push.java
@@ -51,11 +51,6 @@ public class Push extends CordovaPlugin {
         return false;
     }
 
-    public void onReset() {
-        Log.w(LOG_TAG, "onReset");
-
-    }
-
     private void listen(CallbackContext callbackContext) {
         // First, check that we're not already listening.
         if (listening) {
@@ -89,15 +84,10 @@ public class Push extends CordovaPlugin {
     }
     
     private void injectJS(final String toInject) {
-    	injectJS(toInject, false);
-    }
-
-    private void injectJS(final String toInject, final boolean clearCache) {
         this.cordova.getActivity().runOnUiThread(new Runnable() {
             @SuppressLint("NewApi")
             @Override
             public void run() {
-                if (clearCache) webView.clearCache(true);
             	if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
                     webView.loadUrl("javascript:" + toInject);
                 } else {
@@ -108,10 +98,7 @@ public class Push extends CordovaPlugin {
     }
 
     private void restartAppHarness() {
-    	// Clearing the cache is necessary to prevent it loading cached files when the app is
restarted.
-    	// This is a bit heavy-handed, since it's destroying everything in the cache, but on
the other hand
-    	// we're already loading from the local disk, so the cache is superfluous.
-    	injectJS("window.location = '" + Config.getStartUrl() + "'", true /* clearCache */);
+        webView.loadUrlIntoView(Config.getStartUrl(), false);
     }
 
     private class PushServer extends NanoHTTPD {


Mime
View raw message