1

I am downloading multiple videos and showing its progress in list items. I am saving each 5% download information in my sdcard files so that if user clear data of the app still there should be enough information to show pending progress. I am using below code to show progress:

But after i put 5 or 6 videos in download it hangs up whole ui and after some time crashed the app. In my log cat it only shows

03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ java.io.IOException: open failed: EMFILE (Too many open files)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at java.io.File.createNewFile(File.java:941)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at com.intersoft.youngcutsmovies.AppActivity$writeTo.doInBackground(AppActivity.java:162)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at com.intersoft.youngcutsmovies.AppActivity$writeTo.doInBackground(AppActivity.java:123)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at android.os.AsyncTask$2.call(AsyncTask.java:288)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at java.util.concurrent.FutureTask.run(FutureTask.java:237)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at java.lang.Thread.run(Thread.java:818)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ Caused by: android.system.ErrnoException: open failed: EMFILE (Too many open files)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at libcore.io.Posix.open(Native Method)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ at java.io.File.createNewFile(File.java:934)
03-18 10:19:42.651  25120-25626/toteflix.com W/System.err﹕ ... 8 more
Ambrish
  • 3,627
  • 2
  • 27
  • 42
user3759273
  • 63
  • 1
  • 9
  • Add the complete exception from logcat please. – Jens Mar 17 '15 at 13:53
  • This may help... http://stackoverflow.com/questions/20554621/after-a-while-of-usage-my-app-freezes-during-scrolling-a-webview-saying-could – Benyam Ephrem Mar 17 '15 at 15:11
  • possible duplicate of [android EMFILE (Too many open files)](http://stackoverflow.com/questions/11956256/android-emfile-too-many-open-files) – Ambrish Mar 18 '15 at 04:59

0 Answers0