title: How to get document id or name in Android in Firestore db for passing on to another activity?
body: <p>I am using a <code>FirestoreRecyclerAdapter</code>.</p>
  
  <p>I'm able to get each model and attributes of documents. But I want to get the document id. </p>
  
  <p>I tried using <code>model.</code> Autosuggestions, but there was no document id or name</p>
  
  <p>I have the following DealsHolder class. This is in Kotlin. However the rest of all the classes are in java.</p>
  
  <pre><code>package com.guidoapps.firestorerecycleradaptersample
  
  
  import com.google.firebase.firestore.IgnoreExtraProperties
  
  @IgnoreExtraProperties
  data class DealsResponse(var title:String? = null,
                  var price:String? = null,
                  var dealPrice:String? = null,
                  var image:String? = null,
                  var description: String? = null)
  </code></pre>
  
  <p>The following function which I initialize in onCreate()</p>
  
  <pre><code> private void getDealsList(){
          Query query = db.collection("deals").orderBy("dateTime", Query.Direction.DESCENDING);
  
          FirestoreRecyclerOptions&lt;DealsResponse&gt; response = new FirestoreRecyclerOptions.Builder&lt;DealsResponse&gt;()
                  .setQuery(query, DealsResponse.class)
                  .build();
  
          adapter = new FirestoreRecyclerAdapter&lt;DealsResponse, MainActivity.DealsHolder&gt;(response) {
              @Override
              public void onBindViewHolder(MainActivity.DealsHolder holder, int position, DealsResponse model) {
                  progressBar.setVisibility(View.GONE);
                  holder.textTitle.setText(model.getTitle());
                  holder.textPrice.setText(model.getPrice());
                  holder.textDesc.setText(model.getDescription());
                  holder.textDealPrice.setText(model.getDealPrice());
  
                  holder.textPrice.setPaintFlags(holder.textPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
  
                  Glide.with(getApplicationContext())
                          .load(model.getImage())
                          .into(holder.imageView);
  
                  holder.itemView.setOnClickListener(v -&gt; {
                      Snackbar.make(DealsList, model.getTitle(), Snackbar.LENGTH_LONG)
                              .setAction("Action", null).show();
  
                  });
              }
  </code></pre>
  
  <p><strong>Here in the holder.itemView onClickListener I want to get document ID in order to pass to another activity</strong></p>
  
  <p>Then the following DealsHolder.</p>
  
  <pre><code>public class DealsHolder extends RecyclerView.ViewHolder {
      @BindView(R.id.title)
      TextView textTitle;
      @BindView(R.id.thumbnail)
      ImageView imageView;
      @BindView(R.id.description)
      TextView textDesc;
      @BindView(R.id.price)
      TextView textPrice;
      @BindView(R.id.dealPrice)
      TextView textDealPrice;
  
      public DealsHolder(View itemView) {
          super(itemView);
          ButterKnife.bind(this, itemView);
      }
  }
  </code></pre>