aliocrlib/src/main/java/com/lib/aliocr/utils/io/SdCardUtil.java
/*
   * Delete the files older than numDays days from the application cache
   * 0 means all files.
   */
Delete the files older than numDays days from the application cache
0 means all files.
Delete the files older than numDays days from the application cache 0 means all files .
@SuppressLint("DefaultLocale")
    public static void clearWebViewCache(final Context context,
                                         final int numDays) {
        try {
            Log.i(TAG,
                    String.format("开始删除缓存,删除%d天前文件",
                            numDays));
            @SuppressLint("SdCardPath")
            int numDeletedFiles = FileUtil.clearCacheFolder(new File("/data/data/" + context.getPackageName() + "/app_webview"),
                    numDays);
            Log.i(TAG,
                    String.format("缓存完成, 删除%d个文件",
                            numDeletedFiles));
        } catch (Exception e) {
        }
    }
@ SuppressLint ( "DefaultLocale" ) public static void clearWebViewCache ( final Context context , final int numDays ) { try { Log . i ( TAG , String . format ( "开始删除缓存,删除%d天前文件", numDays ) ) ; @ SuppressLint ( "SdCardPath" ) int numDeletedFiles = FileUtil . clearCacheFolder ( new File ( "/data/data/" + context . getPackageName ( ) + "/app_webview" ) , numDays ) ; Log . i ( TAG , String . format ( "缓存完成, 删除%d个文件", numDeletedFiles ) ) ; } catch ( Exception e ) { } }
Delete the files older than numDays days from the application cache
 0 means all files.
Delete the files older than numDays days from the application cache 0 means all files .