If I remove the .whereArrayContainsAny("ItemID", Arrays.asList(onCart)) the statement, there is no error and it retrieves all the documents in a collection, but that is not what I want, I want to retrieve only the documents with ItemID value that is also in the onCart list onCart is from the intent of the prev activity.
error msg: java.lang.IllegalArgumentException: Invalid data. Nested arrays are not supported"
@Override
protected void onStart() {
super.onStart();
List<String> onCart=getIncomingIntent();
loadCart(onCart);
}
private void loadCart(List<String> onCart) {
db.collection("Items")
.whereArrayContainsAny("ItemID", Arrays.asList(onCart))
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
Log.d(TAG, document.getId() + " => " + document.getData());
}
} else {
Log.d(TAG, "Error getting documents: ", task.getException());
}
}
});
}
private List<String> getIncomingIntent() {
if (getIntent().hasExtra("checkOut")) {
return getIntent().getStringArrayListExtra("checkOut");
}
return null;
}}



but the app crashesIf the app crashes, please find the exact error message and stack trace in its logcat output, and add them to your question (there's an edit link under it).onCart, 2) Show a screenshot of a document that you'd expect to get logged inonComplete?