public static void deleteUnusedResource() throws IOException
{
//lint --check "UnusedResources" [project_path] > result.txt
String projectPath = "D:/androidworkspace/SenZone/";
BufferedReader reader = new BufferedReader(new FileReader(
"D:\\result.txt"));
String line;
int count = 0;
while ((line = reader.readLine()) != null)
{
if (line.contains("UnusedResources")
&& !line.contains("res\\value")
&& !line.contains("appcompat"))
{
count++;
int end = line.indexOf(":");
if (end != -1)
{
String file = line.substring(0, end);
String f = projectPath + file;
System.out.println(f);
new File(f).delete();
}
}
}
}
{
//lint --check "UnusedResources" [project_path] > result.txt
String projectPath = "D:/androidworkspace/SenZone/";
BufferedReader reader = new BufferedReader(new FileReader(
"D:\\result.txt"));
String line;
int count = 0;
while ((line = reader.readLine()) != null)
{
if (line.contains("UnusedResources")
&& !line.contains("res\\value")
&& !line.contains("appcompat"))
{
count++;
int end = line.indexOf(":");
if (end != -1)
{
String file = line.substring(0, end);
String f = projectPath + file;
System.out.println(f);
new File(f).delete();
}
}
}
}