In an Android application using Firebase, I need to execute long operations in background once Firebase returns a query answer. E.g.:
query.addListenerForSi
Might be a little too late to the party, but if you want Firebase to return call backs on the background thread, you can use the BACKGROUND_EXECUTOR from com.google.firebase.firestore.util.Executors.BACKGROUND_EXECUTOR like
.addOnCompleteListener(BACKGROUND_EXECUTOR, OnCompleteListener {
...
}
There are other executers as well like -
DEFAULT_CALLBACK_EXECUTOR
DIRECT_EXECUTOR