Open ichou96 opened 6 years ago
Hello @ichou96 I had just quick view your code, i suggest to change the following:
1) Add line in onCreateView()
setHasSyncStatusObserver(KEY, this, db());
2) Change interface which you had implemented
LoaderManager.LoaderCallbacks<Cursor>
3) Change in onLoaderReset()
mAdapter.changeCursor(null);
For more please check framework repository Customers.java class.
Hi, I am using the latest framework version. I tried to implement the procedure listed in the official documentation to add a new module (hr.employee). I followed every step as presented. Unfortunately I am getting a run-time error. Here is the log for the error:
and here is the code for the provider, syncservice, models, main class and xml ressources: Salary.java
` public class Salary extends BaseFragment implements LoaderManager.LoaderCallbacks,ISyncStatusObserverListener, SwipeRefreshLayout.OnRefreshListener, OCursorListAdapter.OnViewBindListener {
} `
Models Employee.java and HrSalary.java
` public class Employee extends OModel { public static final String TAG = Employee.class.getSimpleName();
} `
` public class HrSalary extends OModel { public static final String TAG = HrSalary.class.getSimpleName(); public static final String AUTHORITY = "com.odoo.addons.hr.salary";
} `
SalaryProvider.java
` public class SalaryProvider extends BaseModelProvider { public static final String TAG = SalaryProvider.class.getSimpleName();
} `
SalarySyncService.java
` public class SalarySyncService extends OSyncService { public static final String TAG = SalarySyncService.class.getSimpleName();
} `
salary_sync_adapter.xml
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" android:accountType="com.odoo.auth" android:contentAuthority="com.odoo.addons.hr.salary" android:supportsUploading="true" android:userVisible="true" />
additions in AndroidManifest.xml
` <service android:name="com.odoo.addons.hr.services.SalarySyncService" android:exported="true" android:process=":sync_tasks">
`
I will be grateful if you can tell me what am I doing wrong. Thank you in advance.