我正在尝试使用Android Studio将一些数据上传到Firestore,但是数据无法更新到Firestore
orderAddBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String productName = orderName.getText().toString();
Map<String, String> productMap = new HashMap<>();
productMap.put("name", productName);
mFirestore.collection("Product").add(productMap).addOnSuccessListener(
new OnSuccessListener<DocumentReference>() {
@Override
public void onSuccess(DocumentReference documentReference) {
Toast.makeText(Info.this, "Order Added", Toast.LENGTH_SHORT).show();
}
}
).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
String error = e.getMessage();
Toast.makeText(Info.this, "Error: " + error, Toast.LENGTH_SHORT).show();
}
});
}
});
这是我的logcat错误
E/memtrack: Couldn't load memtrack module
E/GmsContextObserver: Received context data while not listening
E/storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
E/netmgr: WifiForwarder unable to open QEMU pipe: Invalid argument