private Cursor getAllFavorites() {
return mDb.query(DocsDsctnContract.DocsDsctnEntry.Description_Table_Name,
null,
null,
null,
null,
null,
DocsDsctnContract.DocsDsctnEntry.COLUMN_Timest);
}
@Override
public void onResume()
{ // After a pause OR at startup
super.onResume();
mAdapter.swapCursor(getAllFavorites());
mAdapter.notifyDataSetChanged();
}
public void swapCursor(Cursor newCursor){
if (mCursor!=null) mCursor.close();
mCursor = newCursor;
if (newCursor != null){
mAdapter.notifyDataSetChanged();
}
}
I just have favorites category so when i click to the item from favorites there appear such information and if i unlike it - this item should be deleted from Favorites : for that i refresh database and set it to adapter(for recyclerview)[I wish you will understand my problem & solution]