Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的项目中,我必须写入和读取ArrayList<String>包裹,我尝试使用 writeList 和 writeStringList 但没有用,我在读取列表时遇到异常。
ArrayList<String>
任何人都可以帮助我吗?
提前致谢。
来自@JeremyRoman: writeStringList,readStringList并且从 API 1 开始createStringArrayList就存在。Parcel
writeStringList
readStringList
createStringArrayList
Parcel
用这个来写:
bundle.putStringArrayList(KEY, stringArrayList);
这要读:
ArrayList<String> stringArrayList = bundle.getStringArrayList(KEY);