title: how to solve getContentResolver().getType null?
body: <p>I am trying to execute following like following <a href="https://i.stack.imgur.com/xykJD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xykJD.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Uri.parse(pictureImagePath) is
    /storage/emulated/0/Pictures/20171125_131914.jpg</p>
  </blockquote>
  
  <p>But it is returning null. 
  Am i missing something??
  Please help!!!</p>
  
  <p>Following is calling the camera:</p>
  
  <pre><code>if(Build.VERSION.SDK_INT&gt;=24){
              try{
                  Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
                  m.invoke(null);
              }catch(Exception e){
                  e.printStackTrace();
              }
          }
          String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
          String imageFileName = timeStamp + ".jpg";
          File storageDir = Environment.getExternalStoragePublicDirectory(
                  Environment.DIRECTORY_PICTURES);
          pictureImagePath = storageDir.getAbsolutePath() + "/" + imageFileName;
          File file = new File(pictureImagePath);
          Uri outputFileUri = Uri.fromFile(file);
          Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
          cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
          startActivityForResult(cameraIntent, REQUEST_CAMERA);
  </code></pre>
  
  <p>following is the code </p>
  
  <pre><code>                File imgFile = new File(pictureImagePath);
                  if (imgFile.exists()){
  
  
                      bitmapImage = null;
                      bitmapImage = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
                      RequestBody requestFile = RequestBody.create(MediaType.parse(getContentResolver().getType(Uri.fromFile(imgFile))), imgFile);
  </code></pre>