且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

保存/载入图像/从本地存储

更新时间:2023-02-02 21:13:45

是您的文件中获取已保存?如果是的,可能是你做的文件的读取之前的mediascanner不会被触发。由于mediascanner未被触发,因此内容提供商不会有入门
    为您的文件(文件不被索引)。在情况下,你的文件得到保存saveIamgeToLocalStore,然后触发code曾这样mediascanner:

Is your file getting saved? In case yes, may be the mediascanner is not triggered before you do a read of the file. Since the mediascanner is not triggered, so content provider wont have the entry for your file (your file is not indexed).In case your file is getting saved with "saveIamgeToLocalStore", then trigger mediascanner from code once like this:

sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri
                        .parse("file://"
                                + Environment.getExternalStorageDirectory())));

,然后做对文件的读。它应该工作。

and then do a read on the file. It should work.