我下载文件并将其保存到SD卡,并希望捕获事件时,SD卡已满。现在它抛出IOException异常,如果没有记忆留在SD卡。
I am downloading files and saving them to SDCard and want to capture a event when SDCard is full. Right now it throws IOException if no memory is left on SDCard.
如何区分内存已满例外,那么其他的IOExceptions?
How to distinguish the memory full exception then the other IOExceptions?
干杯,Prateek
Cheers, Prateek
如果你知道你有多少数据写入到SD卡上,你可以检查是否有足够的空间,你试图完全写,从而避免IOException异常前
If you know how much data you are writing to the SD card, you could check whether there is sufficient space before you try to write and thus avoid the IOException altogether.
上一篇:创建自定义的墙后对Android的Facebook的API自定义、Android、API、Facebook
下一篇:这允许需要为了得到ACTION_HEADSET_PLUG广播接收机内接收机、ACTION_HEADSET_PLUG