title: Open pdf file url which is stored in Firebase storage
body: <p>I have uploaded a Pdf file to firebase storage, after uploading the pdf file to firebase storage, I am getting the download url. Now I want to open the pdf file from this download url in my application.</p>
  
  <p>Below is the url I am getting after uploading the pdf file to firebase storage.</p>
  
  <blockquote>
    <p><a href="https://firebasestorage.googleapis.com/v0/b/realtime-chat-46f4c.appspot.com/o/documents%2Fbf307aa5-79ae-4532-8128-ee394537b357.pdf?alt=media&amp;token=2d0c5329-4717-4adc-9418-6614913e5bfa" rel="noreferrer">https://firebasestorage.googleapis.com/v0/b/realtime-chat-46f4c.appspot.com/o/documents%2Fbf307aa5-79ae-4532-8128-ee394537b357.pdf?alt=media&amp;token=2d0c5329-4717-4adc-9418-6614913e5bfa</a></p>
  </blockquote>
  
  <p>Now I want to open an intent to view this pdf file, I've used the below code for this : </p>
  
  <pre><code>String url = "https://firebasestorage.googleapis.com/v0/b/realtime-chat-46f4c.appspot.com/o/documents%2Fbf307aa5-79ae-4532-8128-ee394537b357.pdf?alt=media&amp;token=2d0c5329-4717-4adc-9418-6614913e5bfa";
  
  Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
  intent.setDataAndType(Uri.parse(url), "application/pdf");
  startActivity(Intent.createChooser(intent, "Choose an Application:"));
  </code></pre>
  
  <p>My phone is having applications which can open this pdf file, still it says there are no applications installed to view this file.</p>
  
  <p>If I convert this url in File and use the below code, then the chooser of applications get opened but it gives error that the file can't be opened.</p>
  
  <pre><code>Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
  File file = new File(name);
  intent.setDataAndType(Uri.fromFile(file), "aplication/pdf");
  </code></pre>
  
  <p>I've seen many answers that says first download the file and then open it, but I don't want to download the file, I just want to view it.</p>
  
  <p>Please help me if anyone have any idea about this.</p>
  
  <p>Thanks a lot in advanced.</p>