You have to use one single schema in one database to use the built-in relation-mechanics of greendao.
Since you didn't post your schema I can't tell whether you are using a single schema or not or if your schema is containing errors, but you are definitly using two database-files:
database "plcategory-db":
DevOpenHelper plcategoryHelper = new DaoMaster.DevOpenHelper(this,
"plcategory-db", null);
and database "plphone-db":
DevOpenHelper plphoneHelper = new DaoMaster.DevOpenHelper(this,
"plphone-db", null);
Also notice the following:
- Initialization of databases should not occur in the main thread as it may be a lenghty oeration and block the UI.
DevOpenHelper
should be used in development only. I even recommend to not using it at all, but to extendOpenHelper
directly. This way your schema-update-mechanism will be well tested ;)
To reset your adapter you can use the following code:
public void set(ArrayList<String> listDataPLCategoryHeader, ArrayList<ArrayList<PhoneValueGetter>> listDataPLPhoneHeader) {
this._listDataHeader = listDataPLCategoryHeader;
this._listDataChild = listDataPLPhoneHeader;
notifyDataSetChanged();
}