title: App restarts instead of resuming when relaunching from app icon after home button is pressed in signed apk
body: <p>I have an activity in which a form is to be filled by the user.In this activity I am saving data in <code>onPause</code> method and show it back when activity resumes.This works perfectly when i test it in debug mode but when i run <strong>signed apk</strong> after pressing home button and <strong>relaunching the app by clicking app icon the launcher activity is shown</strong>.</p>
  
  <p>I have tried following in Manifest inside <code>formActivity</code> as stated in the following SO questions</p>
  
  <ol>
  <li><code>android:launchMode="singleTask"</code> </li>
  <li><code>android:finishOnTaskLaunch="false"</code></li>
  </ol>
  
  <p><a href="https://stackoverflow.com/questions/8405827/android-app-calls-main-launcher-again-instead-of-onresume">Ques 1</a>
  <a href="https://stackoverflow.com/questions/18449541/android-application-restarts-when-opened-by-clicking-the-application-icon">Ques 2</a></p>
  
  <p>but nothing changed.</p>
  
  <p>It seems like <code>onResume</code> never gets called when app icon is pressed after home button.</p>
  
  <p>My <code>onPause</code> and <code>onResume</code> methods :</p>
  
  <pre><code>@Override
      protected void onPause() {
  
          super.onPause();
          saveFormData(); //function where i save form data 
      }
  
  
  
  @Override
      protected void onResume() {
  
          if (!isActivityCalledFirsTime) {
  
              showSavedFormData(); // function where i show saved data
  
          }
          isActivityCalledFirsTime = false;
          super.onResume();
      }
  </code></pre>
  
  <p><strong>Problem :</strong></p>
  
  <p>1) Why <code>onResume</code> is not called on relaunching the app by clicking app icon ?</p>
  
  <p>2) Is there any other method other than <code>onResume</code> which i can use for signed apk ?</p>
  
  <p><strong>Note :
  Application behaves normally when launched from recent apps after pressing home button</strong></p>