title: How to detect that camera app started from my application has been moved to the backround?
body: <p>In my Qt application for Android, I have to take some actions when the user moves the application to the background. For this task, I use <code>onPause</code> method in my main activity and it works like a charm. </p>
  
  <p>However, I also need to know when the camera app that I started from my application has been moved to the background. </p>
  
  <p><strong>Scenario:</strong></p>
  
  <ol>
  <li>User opens Camera from my application (it is done by <code>startActivityForResult()</code> with <code>MediaStore.ACTION_IMAGE_CAPTURE</code> intent)</li>
  <li>The user moved the app to the background (by clicking the home button or turn off the screen).</li>
  </ol>
  
  <p><strong>Issue</strong>: there is no option to detect that camera application has been moved to the background in this case.</p>
  
  <p>I tried several solutions:</p>
  
  <ol>
  <li><code>onPause</code> / <code>onRemove</code> in mainActivity - obviously it doesn't work because the main activity triggers <code>onPause</code> method as soon as I start Camera activity.</li>
  <li>LifecycleObserver - same as above. It detects pausing when I enter the camera.</li>
  <li>Reading the state of the application from getRunningAppProcesses() - similar results, the state of the app is the same when it is in the background and when the camera is open.</li>
  </ol>
  
  <p>Any ideas will be appreciated.</p>