Launcher Activity does not start on device reboot
<p>I'm facing a very weird problem (replicates only on an HTC sensaation). When I browse my application and power if off, then on restart, if I try to launch the activity, it does not launch on the first try. On tapping the shortcut again, it launches the activity which was on the screen when the device was powered off and not the main/launcher activity. While this behaviour is fine before the device restart (as I handle the savedInstance / restoreInstance and do not use a clearTaskOnLaunch), it goes haywire on the device restart.</p>

<p>Note that htc uses "ACTION_QUICKBOOT_POWERON" for a quick reboot.</p>

<p>The logs are:</p>

<blockquote>
  <ul>
  <li><p>HtcAppUsageStats(240): handleMessage msg=1</p></li>
  <li><p>ActivityManager(240): Starting activity: Intent {    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] 
  flg=0x10200000 cmp=com.myapp.android/.StartActivity } from pid 380</p></li>
  <li><p>HtcAppUsageStats(240): (launch app, package): (myapp,    com.myapp.android.ui)</p></li>
  <li><p>PhoneWindow(380): couldn't save which view has focus because the    focused view<br>
  com.android.internal.policy.impl.PhoneWindow$DecorView@405684b8 has<br>
  no id.</p></li>
  <li><p>ActivityManager(240): moveTaskToBack: 62</p></li>
  </ul>
</blockquote>

<p>Am I missing something here?</p>

<p>The manifest file is:</p>

<blockquote>
<pre><code>&lt;activity
        android:label="@string/app_name"
        android:name=".StartActivity"
        android:screenOrientation="portrait"            
        android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.Black.NoTitleBar" &gt;
        &lt;intent-filter &gt;
            &lt;action android:name="android.intent.action.MAIN" /&gt;
            &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
        &lt;/intent-filter&gt;
    &lt;/activity&gt;
&lt;activity
        android:name=".foreGroundActivity"
        android:screenOrientation="portrait"
        android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.Black.NoTitleBar" /&gt;
</code></pre>
</blockquote>

<p>Isn't it supposed to use start proc to start the application afresh after the PhoneWindow error?
I have checked some other applications on the device and they follow the exact pattern
except that they start the application with:</p>

<blockquote>
  <p>ActivityManager(240): Start proc com.example.android.otherapp for
  activity com.example.android.otherapp/.Otherapp: pid=19915 uid=10116
  gids={}</p>
</blockquote>

<p>My ideal requirement would be to start the application afresh from the launcher activity after a reboot. </p>

<p>Also note that it works fine on other devices.</p>

<p>Can you please help me out?</p>

<p>Thanks in advance.</p>
