How to pass Cursor Object to next Activity using Intents

情到浓时终转凉″ 提交于 2019-12-05 10:45:42
  • Re-query your cursor on the destination side.
  • Store the cursor data in a class which implements Parcelable.(when your cursor data is in small size).

Above both method will work perfectly, concern really coming when you dealing with Static ones.

Remember: To open/close cursor and database when required.

your Cursor is just a reference of your requites query you executed to SQLite and passing Cursor it not good idea . Although if your data is not much sized then you can get data from Cursor and save it in any collection and pass it as serialized form to another activity via intent .

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