Why doesn't setting clearTaskOnLaunch="true" cause OnCreate to be called?

Posted by cbrauer on Stack Overflow See other posts from Stack Overflow or by cbrauer
Published on 2010-04-05T17:57:06Z Indexed on 2010/04/05 19:23 UTC
Read the original article Hit count: 231

Filed under:

My application works fine, once it is initialized in the OnCreate method of my View class. However, when I open my app after the Droid phone has been sitting idle all night, the OnCreate method is not being called.

I use the OnCreate to initialize data, and that in turn initializes the GUI. The GUI clearly shows that OnCreate was not called.

I tried setting clearTaskOnLaunch="true" in my Manifest. My Manifest is:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.hedgetools.trin"
  android:versionCode="2"
  android:versionName="1.02">
  <application android:icon="@drawable/icon"
               android:label="@string/app_name"
               android:clearTaskOnLaunch="true">
    <activity android:name=".Trin"
              android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
  <uses-sdk android:minSdkVersion="6" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

This did not help. My OnCreate method is not being call after the Droid phone sits idle all night.

Why doesn’t clearTaskOnLaunch cause OnCreate to be called?

Any help or suggestions will be greatly appreciated.

Charles

© Stack Overflow or respective owner

Related posts about android