Small improvement

This commit is contained in:
M66B 2019-06-13 13:20:51 +02:00
parent 492c12483a
commit 419e4af5ea
1 changed files with 7 additions and 5 deletions

View File

@ -170,19 +170,21 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
private int load_device() { private int load_device() {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
if (messages == null) {
messages = db.message().getMessageIdsByFolder(folder);
Log.i("Boundary device folder=" + folder + " query=" + query + " messages=" + messages.size());
}
int found = 0; int found = 0;
try { try {
db.beginTransaction(); db.beginTransaction();
if (messages == null) {
messages = db.message().getMessageIdsByFolder(folder);
Log.i("Boundary device folder=" + folder + " query=" + query + " messages=" + messages.size());
}
for (int i = index; i < messages.size() && found < pageSize && !destroyed; i++) { for (int i = index; i < messages.size() && found < pageSize && !destroyed; i++) {
index = i + 1; index = i + 1;
EntityMessage message = db.message().getMessage(messages.get(i)); EntityMessage message = db.message().getMessage(messages.get(i));
if (message == null)
continue;
boolean match = false; boolean match = false;
if (query == null) if (query == null)