title: Cordova Web view cache clear in android
body: <p>I am trying to clear the cache stored in android application which uses cordova webview. 
  I tried with <code>cordovaWebView.clearCache(true);</code> Also tried with </p>
  
  <pre><code>public void deleteCache(Context context) {
          Log.i("Utility", "deleting Cache");
          try {
              File dir = context.getCacheDir();
              if (dir != null &amp;&amp; dir.isDirectory()) {
                  deleteDir(dir);
              }
          } catch (Exception e) {
              Log.e("Utility", " exception in deleting cookies");
          }
  
      }
  
  
  public static boolean deleteDir(File dir) {
          if (dir != null &amp;&amp; dir.isDirectory()) {
              String[] children = dir.list();
              for (int i = 0; i &lt; children.length; i++) {
                  boolean success = deleteDir(new File(dir, children[i]));
                  if (!success) {
                      return false;
                  }
              }
          } else if (dir != null &amp;&amp; dir.isFile()) {
              dir.delete(); // delete the file INSIDE the directory
          }
          Log.i("Utility", "deleting Cache " + dir.delete());
          return true;
      }
  </code></pre>
  
  <p>But both didnt work. 
  May I get any solution for this, as in web view user use to login and hence we need to clear the cache when loading the app second time.</p>