I have to clear cache of all installed applications from my application.I have tried to clear the cache on click of button.But on click of button it throws nullpointerexception.In android market so many applications are there to clear the cache.
But i have to do manually in my program.
This is my code
Button button=(Button) findViewById(R.id.button1);
button.setOnClickListener(this);
@Override
public void onClick(View v) {
File f=new File("/data/data");
File ff[]=f.listFiles();
for(int i = 0; i < ff.length; i++){
ff[i].delete();
}
}
How can i do this ?