I\'m using ORMLite, trying to use the ForeignCollectionKey but I got the following error :
Internal DAO object is null. LazyCollections cannot be use
I solved this problem like Gray suggested: pass the primary key attribute in the Bundle and then obtain the object again from the database in the destination Activity:
Example:
Let's suppose I want to pass a Person object and that I've declared Person.name
as:
@DatabaseField (columnName ="name")
private String name;
Then:
ActivityA
Intent intent = new Intent(ActivityA.this, ActivityB.class);
Bundle bundle = new Bundle();
bundle.putString("NAME" Person.getName());
intent.putExtras(bundle);
ActivityB
String name = getIntent().getExtras().getString("NAME"));
Person p = getHelper().getPersonDao().queryForEq("name", name);
And there you are, your Collection will be refreshed.