if I order the query by the date of the ServerTimeStamp, firestore recyclerview does not update if a document is deleted on Firestore even after restarting the app.
Following code does not work if it is orderBy("date", Query.Direction.DESCENDING)
Query query = FirebaseFirestore.getInstance()
.collection("Ventas "+mes+"-"+ano)
.whereEqualTo("dia", d)
.orderBy("date", Query.Direction.DESCENDING);
FirestoreRecyclerOptions<PojoVenta> opciones = new FirestoreRecyclerOptions
.Builder<PojoVenta>().setQuery(query, PojoVenta.class).build();
adaptador = new AdaptadorVentasRegistradas(opciones);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adaptador);
THIS CODE WORKS AS EXPECTED. I delete a document manually on Firestore, the recyclerview updates correctly.
Query query = FirebaseFirestore.getInstance()
.collection("Ventas "+mes+"-"+ano)
.whereEqualTo("dia", d)
.orderBy("dia", Query.Direction.ASCENDING)
.orderBy("minuto", Query.Direction.ASCENDING);
FirestoreRecyclerOptions<PojoVenta> opciones = new FirestoreRecyclerOptions
.Builder<PojoVenta>().setQuery(query, PojoVenta.class).build();
adaptador = new AdaptadorVentasRegistradas(opciones);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adaptador);