title: intent.setType("application/pdf") allowing any file to select
body: <p>I am making an app in which I want to give the option to upload a pdf file. I have written this code but it is allowing to select any type of document to choose. I want to allow only pdf file to select. I am Targeting API level 28.</p>
  
  <pre><code> case 2:
     Intent pickPdf = new Intent(Intent.ACTION_GET_CONTENT);
     pickPdf.setType("application/pdf");
     pickPdf.addCategory(Intent.CATEGORY_OPENABLE);
     myBundle.putString("type",type);
     try {
       startActivityForResult(Intent.createChooser(pickPdf, "Select a File to Upload"),103);
     } catch (ActivityNotFoundException e) {
       Toast.makeText(GuarantorDocsupload.this, "Please Install a File Manager",Toast.LENGTH_SHORT).show();
     }
     break;
  </code></pre>