I have multiple cursor loaders set up pointing to different URIs in my content provider and they work without any issues. Each loader is for a specific table in my database.
However I have now created a new URI in my content provider to execute a join query on my tables. I have created a new loader that points to the URI to be used for performing a join query but the loader doesn't update the UI.
If I close the app and then open it then the new data appears but after inserting new data in one activity and then returning to my main activity, the data hasn't updated. The loader isn't being called despite the database have new data inserted to it.
I am calling cursor.setNotificationUri(getContext().getContentResolver(), uri); for my new join URI.
Is there any particular reason why this isn't working? Like I said the loaders work fine for standard querying of individual tables but a loader with a join query doesn't.
Is it that a loader can only listen to a single table being updated hence why it can't listen to the join?
EDIT:
Some more information about the workflow...
Activity 1 reads data using a join query of the separate tables and displays to the UI Activity 2 inserts data into separate tables to the database
Activity 1 launches Activity 2 which finishes after inserting data
Activity 1 has a loaders to update the UI. Loaders reading from individual tables works fine but a loader reading from a join query doesn't get called when data is updated. It is only called when the activity is created.
AorBthen only Cursors forAorBare refreshed, but if you have a Cursor forA join Bthen inserting toAis not going to refresh those Cursors. How would it know which other Uris depend onAfor example? Mind you I haven't yet gotten intoContentProviders! I hope you find an answer, I'm curious too. In the meantime you can try inonResume:getLoaderManager().getLoader(id).onContentChanged();- TWiStErRobonResume: getLoaderManager().getLoader(id).onContentChanged();is a good practice? It works but I wonder if it is the best option. - user2844485!getLoaderManager().hasRunningLoaders(). - TWiStErRob