Android的XML阅读问题(的CanRead()= FALSE) [英] Android XML reading issue (canRead() = false)

查看:865
本文介绍了Android的XML阅读问题(的CanRead()= FALSE)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我的应用程序读取XML文件。我尝试过多种选择,但我发现,上面写着ACCES错误是假的。我敢肯定,我使用了正确的路径。

I've a problem with reading a XML file in my APP. I've tried multiple options but I'm getting error that read acces is false. I'm sure I'm using the correct path.

XML =新的文件(XML,file.xml);

  Log.i(XML,读访问:+ XML.canRead());

XML = new File(XML, "file.xml");
Log.i("XML", "Read access:" + XML.canRead());

这不会返回一个错误,我只需要读不写(至少,尚未..)。

This does return a false, I only need to read not to write (at least, not yet..).

System.getProperty(XML.getPath())

System.getProperty(XML.getPath())

返回null

我觉得这是与SD卡有问题(看其他问题)。但是,在我的应用程序,我可以打开文件夹diffent除了在最后一个文件夹XML文件。

I think there is a problem with the SD card (see other issue). But in my app I can open diffent folders except the XML file in the last folder.

我已经添加了正确的权限清单文件。

I've added the correct permission to the manifest file.

任何帮助非常多AP preciated。谢谢你。

Any help is very much appreciated. Thank you.

编辑:
文件路径:

File path:

文件f =新的文件(Environment.getExternalStorageDirectory()。的toString()
                    +文件分割符
                    +external_sd
                    +文件分割符
                    +应用
                    +文件分割符
                    +游戏
                    +文件分割符
                    +VERSION_1
                    );

我已经没有问题打开的文件夹。我在去年的文件夹中有西港岛线是不能打开的XML。

I've no problem with opening the folders. In my last folder there wil be a xml which can't be opened.

我使用的APP的其他部分路径的一部分,并有它的工作原理。

I'm using part of the path in other parts of the APP and there it works..

另外,code XML.exists()返回false ...

Also the code XML.exists() returns false...

推荐答案

是有关其他问题,一个也解决了这个问题。

Was related to to other issue, that one also solved this issue

您的帮助感谢所有..

all thanks for the help..

这篇关于Android的XML阅读问题(的CanRead()= FALSE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆