Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;
import android.content.Context;

public class Main {
    public static void clearCache(Context context) {

        File cache = context.getCacheDir();
        String[] files = cache.list();
        for (String file : files) {
            File data = new File(cache.getPath() + "/" + file);
            data.delete();
        }
    }
}