title: Intent not opening pdf file
body: <p>i found this answer <a href="https://stackoverflow.com/a/10689094/11520105">https://stackoverflow.com/a/10689094/11520105</a> ,and i tried this code ,it pops up dialog to select pdfviewer and when i tap Adobe reader then it simply just launches adobe reader but doesn't launch pdf file</p>
  
  <p>code snippet</p>
  
  <pre><code>pdflistView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
                 UploadPDF uploadPDF = list.get(position);
                 String url = uploadPDF.getUrl();
                 Log.i("url",url);
                  Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
                  intent.setType("application/pdf");
                  PackageManager pm = getPackageManager();
                  List&lt;ResolveInfo&gt; activities = pm.queryIntentActivities(intent, 0);
                  if (activities.size() &gt; 0) {
                      startActivity(intent);
                  } else {
                      // Do something else here. Maybe pop up a Dialog or Toast
                      Toast.makeText(ShowPdfActivity.this, "Can't open pdf", Toast.LENGTH_SHORT).show();
                  }
  </code></pre>
  
  <p>logCat</p>
  
  <pre><code>2020-01-01 18:05:56.259 15148-15148/com.tarandeepsingh.inventory V/FA: onActivityCreated
  2020-01-01 18:05:56.306 15148-15186/com.tarandeepsingh.inventory V/FA: Activity resumed, time: 2896415632
  2020-01-01 18:05:56.320 15148-15186/com.tarandeepsingh.inventory D/FA: Logging event (FE): screen_view(_vs), Bundle[{ga_event_origin(_o)=auto, ga_previous_class(_pc)=MainActivity, ga_previous_id(_pi)=3485492302754114157, ga_screen_class(_sc)=ShowPdfActivity, ga_screen_id(_si)=3485492302754114159}]
  2020-01-01 18:05:57.157 15148-15148/com.tarandeepsingh.inventory I/url: https://firebasestorage.googleapis.com/v0/b/inventory-b98d3.appspot.com/o/uploads%2F1577868311721.pdf?alt=media&amp;token=e543f039-38bd-4881-bcff-48b533ff22bf
  2020-01-01 18:05:57.165 15148-15148/com.tarandeepsingh.inventory I/Timeline: Timeline: Activity_launch_request time:644743239 intent:Intent { act=android.intent.action.VIEW typ=application/pdf }
  2020-01-01 18:05:57.200 15148-15186/com.tarandeepsingh.inventory V/FA: Screen exposed for less than 1000 ms. Event not sent. time: 889
  2020-01-01 18:05:57.207 15148-15186/com.tarandeepsingh.inventory V/FA: Activity paused, time: 2896416520
  2020-01-01 18:05:59.218 15148-15186/com.tarandeepsingh.inventory D/FA: Application going to the background
  2020-01-01 18:05:59.235 15148-15186/com.tarandeepsingh.inventory D/FA: Logging event (FE): app_background(_ab), Bundle[{ga_event_origin(_o)
  </code></pre>
  
  <p>as you can see in logcat , i am getting url but unable to launch default/already installed pdf viewer</p>
  
  <p>thanks</p>