Skip to content

Commit

Permalink
Synchronize Reader Search adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
malinajirka committed Aug 13, 2019
1 parent 08b98d6 commit 8d8b976
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ReaderSearchSuggestionAdapter(Context context) {
mSuggestionBgColor = ContextCompat.getColor(context, R.color.neutral_0);
}

public void setFilter(String filter) {
public synchronized void setFilter(String filter) {
// skip if unchanged
if (isCurrentFilter(filter) && getCursor() != null) {
return;
Expand Down Expand Up @@ -74,7 +74,7 @@ public void setFilter(String filter) {
/*
* forces setFilter() to always repopulate by skipping the isCurrentFilter() check
*/
private void reload() {
private synchronized void reload() {
String newFilter = mCurrentFilter;
mCurrentFilter = null;
setFilter(newFilter);
Expand Down Expand Up @@ -180,7 +180,7 @@ public void onClick(DialogInterface dialog, int id) {
alert.show();
}

private void clearSavedSearches() {
private synchronized void clearSavedSearches() {
ReaderSearchTable.deleteAllQueries();
swapCursor(null);
}
Expand Down

0 comments on commit 8d8b976

Please sign in to comment.