Closed codeversed closed 8 years ago
:+1:
Here is an example creating a CursorLoader using the existing generated code using the sample project:
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
String[] projection = { PersonColumns._ID, PersonColumns.FIRST_NAME,
PersonColumns.LAST_NAME, PersonColumns.AGE };
final PersonSelection ps = new PersonSelection();
ps.id(2);
return new CursorLoader(this, ps.uri(), projection, ps.sel(), ps.args(), ps.order());
}
I'm not sure if this is better as a documentation update or a new generated function?
Hi, i've been trying to use this generator in my project and i've done everything the right way. But i'm getting empty cursor on onLoadFinished. I' m creating the loader as above but no results. Any help advices?
Thanks in advance
Forget it...newbie bad forgetting to populate the DB looool. But thanks any how
Maybe if we can see your code that would help us help you.
My code its fine. I'm using a sync service to get the data from a server to populate the DB and i forgot to call the sync adapter in main activity. Now its working fine. Newbie mistake.
And congrats for the nice work. this generator saved me hours of implementation.
Keep up the good work.
Thanks for the quick reply.
You're welcome, and thanks 😊
In b7be6a0, I added a getCursorLoader()
method in Selection objects :)
This will be in version 1.10.0.
I have been playing around with the idea that the _Object_Selection class would have a method to return a CursorLoader.
Something like this:
I am personally stuck on how to get the AbstractSelection to come into effect. Would we need a _Object_CursorLoader that extends a _Object_AbstractCursorLoader?It seems that adding that Edited code above to the selection class would work well but I am not sure if it is nessessary.