fixed bug in search adapter
This commit is contained in:
parent
399037d49b
commit
71fcd174d7
@ -65,7 +65,7 @@ public class HistoryDatabase extends SQLiteOpenHelper {
|
|||||||
onCreate(db);
|
onCreate(db);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isClosed() {
|
public boolean isClosed() {
|
||||||
return mDatabase == null || !mDatabase.isOpen();
|
return mDatabase == null || !mDatabase.isOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ public class SearchAdapter extends BaseAdapter implements Filterable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (mDatabaseHandler == null) {
|
if (mDatabaseHandler == null || mDatabaseHandler.isClosed()) {
|
||||||
mDatabaseHandler = HistoryDatabase.getInstance(mContext.getApplicationContext());
|
mDatabaseHandler = HistoryDatabase.getInstance(mContext.getApplicationContext());
|
||||||
}
|
}
|
||||||
List<HistoryItem> historyList = mDatabaseHandler.findItemsContaining(constraint.toString());
|
List<HistoryItem> historyList = mDatabaseHandler.findItemsContaining(constraint.toString());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user