title: Deleting a document from Firestore via Auto-generated document ID
body: <p>I'm trying to create a Property Rental application on Android using Firebase Firestore. Right now, I'm trying to implement a method to delete a specific document (property) within my collection inside Firestore. I figure it is by referencing the auto-generated ID for that particular document, but I simply couldn't get around it.</p>
  
  <p>This is how the delete feature should work:</p>
  
  <ol>
  <li>User clicks on a property item from the <a href="https://i.stack.imgur.com/55hav.jpg" rel="nofollow noreferrer"><code>RecyclerView</code></a></li>
  <li>It displays a full profile of that <a href="https://i.stack.imgur.com/sUAIR.jpg" rel="nofollow noreferrer">property</a></li>
  <li>User clicks the delete button from the top right corner and deletes the property from the <a href="https://i.stack.imgur.com/9mo95.jpg" rel="nofollow noreferrer">Firestore database</a></li>
  </ol>
  
  <p>Here is my code where I'm stucked at:</p>
  
  <pre><code>@Override
  public boolean onOptionsItemSelected(MenuItem item) {
  
      switch(item.getItemId()){
          // The delete button
          case R.id.action_delete_btn:
              // Do this when user clicks on delete button
              Toast.makeText(PropertyProfile.this, "You tried to delete this property", Toast.LENGTH_LONG).show();
  
              deleteItem(item.getOrder());
              return super.onOptionsItemSelected(item);
  
          default:
              return false;
      }
  }
  
  // Here's my problem
  private void deleteItem(int index) {
      firebaseFirestore.collection("Posts")
          .document("[DOCUMENT ID RIGHT HERE!]")
          .delete()
          .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {
              @Override
              public void onSuccess(Void aVoid) {
                  Toast.makeText(PropertyProfile.this, "You successfully deleted this property", Toast.LENGTH_LONG).show();
              }
          });
  }
  </code></pre>