title: PDF Dowload or Intent
body: <p>I made a <code>RecyclerView</code> with <code>CardViews</code> that retrieve two <code>TextViews</code> from the Cloud Firestore and whenever I click on the card, I want it, based on the <code>pdfUrl</code> stored in my Firestore database, that an activity be opened with the pdf or donwload the pdf to the phone. But I don't know how to achieve that.</p>
  
  <p><a href="https://i.stack.imgur.com/BcjGH.png" rel="nofollow noreferrer">Here's my firestore structure</a></p>
  
  <p>My code:</p>
  
  <pre><code>public class RecylerViewTestsActivity extends AppCompatActivity {
  
  RecyclerView recyclerView;
  private FirebaseFirestore db = FirebaseFirestore.getInstance();
  private FirestoreRecyclerAdapter&lt;uploadTests, TestesViewHolder&gt; adapter;
  
  
  
  @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.recyler_view_tests);
  
      RecyclerView recyclerView = findViewById(R.id.recyclerViewTests);
      recyclerView.setLayoutManager(new LinearLayoutManager(this));
  
      FirebaseFirestore rootRef = FirebaseFirestore.getInstance();
      Query query = rootRef.collection("FilterPDFUploads");
  
  
      FirestoreRecyclerOptions&lt;uploadTests&gt; options = new FirestoreRecyclerOptions.Builder&lt;uploadTests&gt;()
              .setQuery(query, uploadTests.class)
              .build();
  
      adapter = new FirestoreRecyclerAdapter&lt;uploadTests,TestesViewHolder &gt;(options) {
          @Override
          protected void onBindViewHolder(@NonNull TestesViewHolder holder, int position, @NonNull uploadTests model) {
              holder.setTestesDesc(model.getDescription());
              holder.setTestesName(model.getUsername());
  
          }
  
          @NonNull
          @Override
          public TestesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
              View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.pdf_tests_items, parent, false);
              return new TestesViewHolder(view);
          }
      };
      recyclerView.setAdapter(adapter);
  
  
  }
  
  //////////////////////////VIEW HOLDER////////////////////////////////////////////
  
  private class TestesViewHolder extends RecyclerView.ViewHolder {
      private View view;
      private CardView itemsCard;
  
      TestesViewHolder(final View itemView) {
          super(itemView);
          view = itemView;
  
      }
  
      void setTestesDesc (String descri) {
          TextView desc = view.findViewById(R.id.teste_description);
          desc.setText(descri);
      }
      void setTestesName (String username) {
          TextView user = view.findViewById(R.id.name_id);
          user.setText(username);
      }
      void setPdfUrl(final String url){
  
      }
  }
  
  //////////////////////////VIEW HOLDER////////////////////////////////////////////
  
  @Override
  protected void onStart() {
      super.onStart();
      adapter.startListening();
  }
  
  @Override
  protected void onStop() {
      super.onStop();
  
      if (adapter != null) {
          adapter.stopListening();
      }
  }
  </code></pre>
  
  <p>}</p>