Created
May 16, 2018 15:46
-
-
Save griajobag/97a6a8bafc5f1bc9b40d39be6bc36cfd to your computer and use it in GitHub Desktop.
firestores
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void deleteData(){ | |
progressDialog.setMessage("Deleting Data..."); | |
progressDialog.show(); | |
CollectionReference collectionReference = firebaseFirestore.collection("data"); | |
DocumentReference documentReference = collectionReference.document(modelWebsite.get(0).getIdDocument()); | |
documentReference.delete() | |
.addOnCompleteListener(task -> { | |
progressDialog.dismiss(); | |
Toast.makeText(MainActivity.this, "Deleting successfulyy", Toast.LENGTH_SHORT).show(); | |
}).addOnFailureListener(new OnFailureListener() { | |
@Override | |
public void onFailure(@NonNull Exception e) { | |
progressDialog.dismiss(); | |
Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment