java - Android Clear Data programmatically -


following answer https://stackoverflow.com/a/19831167/2956344

i try clear data package. when try clear data have null pointer exception in line :

...   if (appdir.exists() && appdir.isdirectory()) {             string[] children = appdir.list();             (string s : children) {           // npe! children null                 if (!s.equals("lib")) {                     deletedir(new file(appdir, s));                     toast.maketext(this, "app data deleted", toast.length_long)                             .show();                 }             }         } ... 

file-explorer tool show me folder contains files. , confusion this. tell me what's wrong?

the array empty if directory empty. returns null if abstract pathname not denote directory, or if i/o error occurs.is there i/o error happening?


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -