title: Restricting selectable file types via intent in Android
body: <p>I am uploading selected files to server but I want to restrict users to pick only document files (.doc, .pdf, etc.) and image files.</p>
  
  <p>For now my code is working for all files it fetches uri of all files.</p>
  
  <p>How can I restrict users to pick only specific types of file?</p>
  
  <p>Here is my code to pick any file.</p>
  
  <pre><code>Intent i=new Intent();
  i.setType("*/*");
  i.setAction(Intent.ACTION_GET_CONTENT);
  i.addCategory(Intent.CATEGORY_OPENABLE);
  startActivityForResult(Intent.createChooser(i, "abc"),requestCode);
  </code></pre>