android中图库读取SD卡中图片时,当SD卡存储空间满时,不能读出图库文件,加个toast提示SD卡空间已满,请问这在哪里加啊,谢谢!

解决方案 »

  1.   

    google下 记得有方法可以获取sd的剩余空间,也有方法可以获取文件的大小,比较下给出提示。
      

  2.   

    你判断SD卡有没有满,如果慢了就        Toast.makeText(this, "SD卡满了", Toast.LENGTH_LONG).show();
      

  3.   

    判断出来sd卡已满,随后直接用toast显示就可以了。
      

  4.   

     private static void syncCache(Context context) {
            if (!isCacheReady(true)) {
                // In this case, we should try to show a toast
                if (context instanceof Gallery) {            
                    if (mbSDMemoryLimit){
                 App.get(context).showToast(context.getResources().getString(Res.string.sd_full), Toast.LENGTH_LONG);
                 }
    else{
                 App.get(context).showToast(context.getResources().getString(Res.string.loading_new), Toast.LENGTH_LONG);
                 }
                }