title: After taking picture using camera , black screen comes for few seconds (2 or 3 seconds)
body: <p>After taking picture using camera , black screen comes for few seconds (2 or 3 seconds) before the UI layout is shown. I use asynchronous task to get the saved file as shown below. The functionality is working fine. But the user experience is bad because of few seconds black screen.</p>
  <p>Camera Intent code</p>
  <pre><code>Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
          File imagefile=null;
          File storageDir = getExternalFilesDir(Environment.DIRECTORY_PICTURES);
          try {
              imagefile = File.createTempFile(&quot;zicu&quot;, &quot;.jpg&quot;, storageDir);
          } catch (IOException e) {
              e.printStackTrace();
          }
          pictureFilePath = imagefile.getAbsolutePath();
          Uri photoURI = FileProvider.getUriForFile(this,
                  &quot;com.mmxyz.zicu.fileprovider&quot;,
                  imagefile);
          cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
          startActivityForResult(cameraIntent, 2);
  </code></pre>
  <p><code>onActivityResult</code> code</p>
  <pre><code>if ((requestCode == 2))
          {
              
            Feedcamera fc= new Feedcamera();
             fc.execute(&quot;0&quot;);
             var_textview_error.setText(&quot;Processing....&quot;);
  }
  </code></pre>
  <p><strong>Asynchronous task</strong></p>
  <pre><code>private class Feedcamera extends AsyncTask&lt;String, Void, File&gt; {
  
          protected File doInBackground(String... urls) {
              
              File imgFile = new  File(pictureFilePath);
              return imgFile;
  
  
          }
  
  
          protected void onPostExecute(File imgFile) {
  
  
              if(imgFile.exists())            {
                  var_imageview_browse.setImageURI(Uri.fromFile(imgFile));
              }
  </code></pre>