我熟悉如何从一个活动传递原始数据(字符串,整型,布尔型等等)到另一个活动。但是,在我的应用程序,我想一个光标对象传递给下一个活动。我从活动类扩展我的课。
I'm familiar with how to pass Raw Data(String, int, boolean etc) from one Activity to another Activity. But in my application, I want to pass a Cursor object to next Activity. I'm extending my class from the Activity Class.
虽然我已经看过这个post.但是它提供cotradictory解决方案。然而,所描述的用户之一,应该延长应用程序类通过游标数据。但是我想延长活动类。那么,有没有办法从一个活动到另一个活动通过光标数据。
Though I have looked at this post. but it provides cotradictory solutions. However, as described by one of the users, one should extend Application class to pass cursor data. But I want to extend Activity class. So is there any way to pass Cursor data from an Activity to another Activity.
注意 - 如果有帮助,我为什么要使用光标的事实是,我是查询数据的特定联系人点击从列表并将其保存在游标,我想同样的光标数据传递到下一个Actvity。
Note- If it helps, the fact why I want to use the cursor is, I'm querying data for a particular contact clicked from the list and saving it in the cursor and I want to pass the same cursor data to the next Actvity.
推荐答案- 重新查询光标放在目标身边。
- 店铺光标数据,它实现了Parcelable。(当你的光标数据在小尺寸)的类。
以上两种方法很好地工作,关心,当你处理静态的真的来了。
Above both method will work perfectly, concern really coming when you dealing with Static ones.
记住:要打开/关闭光标和数据库需要的时候的
更多推荐
如何使用意图传递光标对象到下一个活动
发布评论