Exemplo n.º 1
0
  /*
   * PUBLIC FUNCTIONS
   */
  public void clearCache() {
    File[] files = cacheDir.listFiles();
    if (files == null) return;
    for (File f : files) f.delete();

    Toast.makeText(
            mContext,
            String.format("%.2f", mDirSize / 1024. / 1024.0f) + "MB deleted",
            Toast.LENGTH_SHORT)
        .show();
    mDirSize = 0;
    commmitDirSize();
  }
Exemplo n.º 2
0
 // Force calculate dirSize
 // WARNING : possibly could take some time. preferably called in a thread
 public void forceUpdateDirSize() {
   calcDirSize();
   commmitDirSize(); // Updates mUtil with latest calculated value
 }