Last active
May 16, 2018 14:43
-
-
Save griajobag/dfec6e143a4d6240eaf9805435ce94e3 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 startInsertDataDocumentGeneratedSendiri() { | |
progressDialog.show(); | |
WebsiteModel model = new WebsiteModel("Droid Newbie","androidbie.com","About Programming"); | |
CollectionReference collectionReference = firebaseFirestore.collection("data"); | |
collectionReference.add(model) | |
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() { | |
@Override | |
public void onSuccess(DocumentReference documentReference) { | |
progressDialog.dismiss(); | |
Toast.makeText(MainActivity.this, "Berhasil Insert Data", Toast.LENGTH_SHORT).show(); | |
} | |
}) | |
.addOnFailureListener(new OnFailureListener() { | |
@Override | |
public void onFailure(@NonNull Exception e) { | |
progressDialog.dismiss(); | |
Toast.makeText(MainActivity.this, "Gagal Insert Data", Toast.LENGTH_SHORT).show(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment