title: android.net.Uri$HierarchicalUri cannot be cast to java.util.ArrayList
body: <p>I am having this problem when trying to share single or multiple files with my app. When I select a single file and tap share icon and choose my application, i get the uri of the file, whereas when i select multiple files, i get an Arraylist of uri. Below is my code.</p>
  
  <pre><code> protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
     // AuthDetails.initiate(this);
      setContentView(R.layout.activity_pdfupload);
  
      ArrayList&lt;String&gt; fileUriList= (ArrayList&lt;String&gt;) getIntent().getExtras().get(Intent.EXTRA_STREAM);
      Log.e("urilist", fileUriList.toString());
  
  
      init();
  
      btCancel.setOnClickListener(cancelUploadListener);
      btUploadPDF.setOnClickListener(uploadPdfListener);
  }
  </code></pre>
  
  <p>I am getting the following exception.</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: android.net.Uri$HierarchicalUri cannot be cast to java.util.ArrayList
                                                                  at com.example.newActivity.activities.PDFUploadActivity.onCreate(PDFUploadActivity.java:44)
  </code></pre>
  
  <p>Is there a way to manage both single selection and multiple selection scenarios?</p>