I have the code as shown here. My Problem is a NullPointerException at files.length
for(int i=0; i < files.length; i++){
It is caused b
f.listFiles()
will return null if the path does not exist.
Please check your path.
Update
Android will also require a permission to read certain files. Maybe you need to add this to your manifest:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
More information:
http://developer.android.com/reference/android/Manifest.permission.html
i have check the condition
File folderPath = new File(getFilesDir() + "/" + getResources().getString(R.string.app_name));
if (folderPath.exists()) {}
for my code and it works for me becuase when this file attemp to read data there were no directory exist on the storage so that it was giving error.
now works fine