Browse Source

fixed bug in search adapter

master
Anthony Restaino 9 years ago
parent
commit
71fcd174d7
  1. 2
      app/src/main/java/acr/browser/lightning/database/HistoryDatabase.java
  2. 2
      app/src/main/java/acr/browser/lightning/object/SearchAdapter.java

2
app/src/main/java/acr/browser/lightning/database/HistoryDatabase.java

@ -65,7 +65,7 @@ public class HistoryDatabase extends SQLiteOpenHelper { @@ -65,7 +65,7 @@ public class HistoryDatabase extends SQLiteOpenHelper {
onCreate(db);
}
private boolean isClosed() {
public boolean isClosed() {
return mDatabase == null || !mDatabase.isOpen();
}

2
app/src/main/java/acr/browser/lightning/object/SearchAdapter.java

@ -232,7 +232,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable { @@ -232,7 +232,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
}
}
if (mDatabaseHandler == null) {
if (mDatabaseHandler == null || mDatabaseHandler.isClosed()) {
mDatabaseHandler = HistoryDatabase.getInstance(mContext.getApplicationContext());
}
List<HistoryItem> historyList = mDatabaseHandler.findItemsContaining(constraint.toString());

Loading…
Cancel
Save