安卓getShared preferences错误:地图值,而name属性:布尔布尔、属性、错误、地图

由网友(炕上随你弄)分享简介:我想弄清楚这个错误发生在启动的原因,当我尝试获取共享preferences的应用程序。在code就是:设置= this.getShared preferences(全局。preFS_NAME,0)似乎是一个腐败,但错误是在应用程序,因为我有多个设备上安装了它,会出现同样的错误。我已经卸载应用程序,并重新安装了它无济于事...

我想弄清楚这个错误发生在启动的原因,当我尝试获取共享preferences的应用程序。在code就是:

设置= this.getShared preferences(全局。preFS_NAME,0)

似乎是一个腐败,但错误是在应用程序,因为我有多个设备上安装了它,会出现同样的错误。我已经卸载应用程序,并重新安装了它无济于事。还做了一个完全干净的构建。我一派错误和不似乎能够找到的任何东西。

我是previously工作的罚款。所以我是一个相当难住了。任何线索会的非常的高度AP preciated ...

问候,

  W / ApplicationContext的(1541):getShared preferences
W / ApplicationContext的(1541):org.xmlpull.v1.XmlPullParserException:地图值,而name属性:布尔
W / ApplicationContext的(1541):在com.android.internal.util.XmlUtils.readThisMapXml(XmlUtils.java:521)
W / ApplicationContext的(1541):在com.android.internal.util.XmlUtils.readThisValueXml(XmlUtils.java:733)
W / ApplicationContext的(1541):在com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:667)
W / ApplicationContext的(1541):在com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:470)
W / ApplicationContext的(1541):在android.app.ContextImpl.getShared preferences(ContextImpl.java:376)
W / ApplicationContext的(1541):在android.content.ContextWrapper.getShared preferences(ContextWrapper.java:146)
W / ApplicationContext的(1541):在net.robmunro.mypod.WelcomeActivity.onEWCreate(WelcomeActivity.java:160)
W / ApplicationContext的(1541):在net.robmunro.mypod.AbstractEWActivity.onCreate(AbstractEWActivity.java:25)
W / ApplicationContext的(1541):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W / ApplicationContext的(1541):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
W / ApplicationContext的(1541):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
W / ApplicationContext的(1541):在android.app.ActivityThread.access $ 1500(ActivityThread.java:117)
W / ApplicationContext的(1541):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:931)
W / ApplicationContext的(1541):在android.os.Handler.dispatchMessage(Handler.java:99)
W / ApplicationContext的(1541):在android.os.Looper.loop(Looper.java:123)
W / ApplicationContext的(1541):在android.app.ActivityThread.main(ActivityThread.java:3683)
W / ApplicationContext的(1541):在java.lang.reflect.Method.invokeNative(本机方法)
W / ApplicationContext的(1541):在java.lang.reflect.Method.invoke(Method.java:507)
W / ApplicationContext的(1541):在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:839)
W / ApplicationContext的(1541):在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
W / ApplicationContext的(1541):在dalvik.system.NativeStart.main(本机方法)
 

解决方案

您能够重现这对模拟器?如果是的话,那么你可以使用Eclipse DDMS工具,调查preFS文件的内容提取preFS文件。

九 使用SharedPreferences进行数据存储

I am trying to figure out the cause of this error it occurs on startup when i try to get the shared preferences for the app. the code is just:

settings = this.getSharedPreferences(Globals.PREFS_NAME, 0)

Seems like a corruption, but the bug is in the app as i have installed it on multiple devices and the same error occurs. I have uninstalled the app and re-installed it to no avail. also did a fully clean build. I googled the error and dont seem to be able to find anything on it.

I was previously working fine. so I am a rather stumped. Any leads would be very highly appreciated ...

regards,

rob

W/ApplicationContext( 1541): getSharedPreferences
W/ApplicationContext( 1541): org.xmlpull.v1.XmlPullParserException: Map value without name attribute: boolean
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readThisMapXml(XmlUtils.java:521)
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readThisValueXml(XmlUtils.java:733)
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:667)
W/ApplicationContext( 1541):    at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:470)
W/ApplicationContext( 1541):    at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:376)
W/ApplicationContext( 1541):    at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:146)
W/ApplicationContext( 1541):    at net.robmunro.mypod.WelcomeActivity.onEWCreate(WelcomeActivity.java:160)
W/ApplicationContext( 1541):    at net.robmunro.mypod.AbstractEWActivity.onCreate(AbstractEWActivity.java:25)
W/ApplicationContext( 1541):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
W/ApplicationContext( 1541):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
W/ApplicationContext( 1541):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
W/ApplicationContext( 1541):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
W/ApplicationContext( 1541):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
W/ApplicationContext( 1541):    at android.os.Handler.dispatchMessage(Handler.java:99)
W/ApplicationContext( 1541):    at android.os.Looper.loop(Looper.java:123)
W/ApplicationContext( 1541):    at android.app.ActivityThread.main(ActivityThread.java:3683)
W/ApplicationContext( 1541):    at java.lang.reflect.Method.invokeNative(Native Method)
W/ApplicationContext( 1541):    at java.lang.reflect.Method.invoke(Method.java:507)
W/ApplicationContext( 1541):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
W/ApplicationContext( 1541):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
W/ApplicationContext( 1541):    at dalvik.system.NativeStart.main(Native Method)

解决方案

Are you able to reproduce this on emulator? If yes, then you could extract the prefs file using Eclipse DDMS tools to investigate the contents of the prefs file.

阅读全文

相关推荐

最新文章