I my application I am parsing one html file and storing in app local files directory.this I am doing in onCreate(). Now their is one button “open”,when I click the “open” button I am showing android chooser dialog by giving the path as files directory.
then in the onDestroy() I am deleting all the files which are stored in files directory.this is working upto 4.0.
but in 4.1 ,since once we open the chooser dialog ,it immediately calling onDestroy(). By the time another app (ex:Html viewer) tries to open the file ,file will not be available .so it is displaying file not found.so where to delete the local files?.
Try this code
Put this code inside the
onDestroy()