Not back on main thread when query.runAsync completes

15 weergaven
Naar het eerste ongelezen bericht

macs.d...@gmail.com

ongelezen,
17 jul 2015, 07:03:4117-07-2015
aan mobile-c...@googlegroups.com
Hi i am using couchbase mobile 1.1 on android and i am getting an CalledFromWrongThreadException when i try to update the ui within query.runAsync's completed callback. I assumed that when a async task completes that i am back on the main threat.
It seems runAsync works differently, however, i am not able to find much in the docs about it. advice would be very much appreciated (better stick to good old AsyncTask here?)


        query.runAsync(new QueryCompleteListener() {
             
@Override
             
public void completed(QueryEnumerator result, Throwable error) {
                 
if (error != null) {
                      ui
.update(result); //throws exception
               
}
             
}
       
});


Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten