Storing a Parcelable object to a File in Android

℡╲_俬逩灬. 提交于 2019-12-07 12:04:02

问题


I am trying to store an ArrayList of ResolveInfo objects to a file so that I don't have to rebuild it each time my application launches (about 4-6 seconds) ResolveInfo objects are Parcelable, but not Serializable so I get a java.io error when I try to write the objects.

I have stored them in my savedInstanceState bundle, but that doesn't help when closing the application. Am I doing something plain wrong?


回答1:


savedInstance info will not save across multiple sessions. You will really want to implement Serializable to save your ResolveInfo.



来源:https://stackoverflow.com/questions/7135086/storing-a-parcelable-object-to-a-file-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!