The accepted answer was a little difficult to understand, so I am writing an answer to make it easy for other developers.
- Go to the class where you extended
ContentProvider Find the query () method that has the following syntax
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
Write this line where you return the cursor
cursor.setNotificationUri(getContext().getContentResolver(), uri); return cursor;
At the end, my query method is as follows:
@Nullable @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { Cursor cursor; cursor = noticeDbHelper.getReadableDatabase().query( NoticeContract.NoticeTable.TABLE_NAME, projection, selection, selectionArgs, null, null, sortOrder );
Manish Menaria Feb 22 '17 at 12:01 2017-02-22 12:01
source share