title: Need to upload only pdf or any doc type format in android
body: <p>I'm trying to upload only pdf or any doc type files but .gif and .psd format is also getting added. I need to upload only supported file format.</p>
  
  <pre><code>resume_add.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  if (ActivityCompat.checkSelfPermission(MyProfileActivity.this, android.Manifest
                          .permission.WRITE_EXTERNAL_STORAGE) != PackageManager
                          .PERMISSION_GRANTED) {
                      requestPermissions(new String[]{android.Manifest.permission
                              .WRITE_EXTERNAL_STORAGE}, 1);
                  } else {
                      Intent target = FileUtils.createGetContentIntent();
                      Intent intent = Intent.createChooser(target, "Select File");
                      intent.setType("application/msword,application/pdf");
                      try {
                          startActivityForResult(intent, SELECT_PICTURE);
                      } catch (ActivityNotFoundException ignored) {
  
                      }
                  }
              } else {
                  Intent target = FileUtils.createGetContentIntent();
                  Intent intent = Intent.createChooser(target, "Select File");
                  try {
                      startActivityForResult(intent, SELECT_PICTURE);
                  } catch (ActivityNotFoundException ignored) {
  
                  }
              }
  
          }
      });
  </code></pre>