
我在另一个拥有AndroID 4.0.4的Nexus上重新测试了这个,但结果仍然相同.
可能是什么原因?
解决方法 您可能需要通过MediaScannerConnection索引文件.引用自己 from a blog post from last year:总结…the MTP contents are not based on the literal contents of external storage. Instead,MTP contents are based on what files have been scanned by MediaScannerConnection. If you write a file to external storage,until and unless that file is scanned by MediaScannerConnection,it will not be visible to users over MTP.
External storage is scanned on a reboot and possibly on a periodic basis. Users can manually force a scan via utilitIEs like SDRescan. However,the best answer is for you to use scanfile() on MediaScannerConnection to update the media database after you close your file. This will make your file immediately available to the user.
以上是内存溢出为你收集整理的android – SDCard内容存在但无法看到它们全部内容,希望文章能够帮你解决android – SDCard内容存在但无法看到它们所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)