Result code 0 for Camera Intent
<p>Code:-</p>

<pre><code>  Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);                                   
        try{
               imageUri = Uri.fromFile(File.createTempFile("image", ".jpg"));
           }catch (Exception ex){
               ex.printStackTrace();
          }

   intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageUri);
    startActivityForResult(intent, REQUEST_CAMERA);
</code></pre>

<p>I am using all permissions related to this in android manifest file...
that above intent is working fine in mot g3 turbo and many more devices but in the case of only nexus 5 the resultCode is coming 0.. why? </p>