title: Android WebView prevent page reload
body: <p>I have a Phonegap packaged application that opens a PDF Viewer when a button is pressed. I did it with the FileOpener2 plugin.</p>
  
  <p>When I go back to the application from the PDF Viewer, the result differs depending on Android versions.</p>
  
  <p>In Android 4.* the application stays where it should be before leaving the application. However, in Android 2.3.7 the WebView reloads the application, which is the behaviour I don´t expect.</p>
  
  <p>I already tried changing android:launchmode to singleTask or singleInstance with no success.</p>
  
  <p>How can I avoid page reload when I came back to the Phonegap application?</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>I have modified the Cordova or Phonegap class CordovaWebViewClient which extends WebViewClient with:</p>
  
  <pre><code>@Override
  public void onLoadResource(WebView view, String url) {
      if (url.equals("file:///android_asset/www/index.html")) {
          if (this.firstLoad) {
              this.firstLoad = false;
          } else {
              view.stopLoading();
          }
      }
  </code></pre>
  
  <p>However the onLoadResource only gets fired when the application started and not when it resumes from another application.</p>