title: Restart App after updating a new version in android
body: <p>I believe that this question duplicate this
  <a href="https://stackoverflow.com/questions/15572154/auto-restart-app-after-market-update">Auto-restart app after market update</a></p>
  
  <p>Anytime I publish a new version of my app in the Market, if the user had enabled the "auto update" option, the app will be updated automatically.</p>
  
  <p>The app contains a service that runs constantly. But when the automatic update happens, the old running app is killed, but the new one is not started. Since the update happens mostly transparently to the user, it makes sense that the app's service should be started again automatically after the update so that there is almost no interruption of the service.</p>
  
  <p>It's a bit difficult to test this with a real update from the market, so I'm using the following two adb commands to simulate this update process. Install of the 1st version:</p>
  
  <p>adb install oldversion.apk // (version code is 1 )
  Automatic update:</p>
  
  <p>adb install -r newversion.apk // (version code is 2)</p>
  
  <p>In my case, I have two activities, the first is MainActivity and the secondActivity. If the user is using the secondActivity and app is updated automatically (for me, I am using adb command to install the new version), how to trigger run MainAcitivty after the app is updated a new version successfull? </p>