androidsigningandroid-launcherandroid-homebutton

Android Launcher Application not detecting Home key after signing with keystore


I am creating a Launcher Application in Android Ice Cream Sandwich.

I have 3 Activities. This is how they are declared in the manifest file.

    <activity
        android:label="@string/app_name"
        android:name=".ActivityOne" 
        android:theme="@android:style/Theme.Light.NoTitleBar"
        >
        <intent-filter >
              <action android:name="android.intent.action.MAIN" />    
             <category android:name="android.intent.category.HOME"/>    
            <category android:name="android.intent.category.DEFAULT" /> 
              <category android:name="android.intent.category.LAUNCHER" />  
        </intent-filter>
    </activity>

         <activity android:name=".Activitytwo"
        android:theme="@android:style/Theme.Light.NoTitleBar">

    </activity>

    <activity android:name=".ActivityThree"
        android:theme="@android:style/Theme.Light.NoTitleBar">

    </activity>

After installing the apk in phone and pressing the Home Key in the System Bar takes me to "ActivityOne". This is working perfectly fine.

Then I created a key to sign the apk. Exported the project from Eclipse and signed the apk. Now pressing the Home key has no effect.

I need the application to work the same way as it was, after signing.

Any ideas ?


Solution

  • Solved it.

    Adding the following line in the manifest under activity tag the solved it.

    android:launchMode="singleTask"
    
    <activity
        android:label="@string/app_name"
        android:name=".ActivityOne"
        android:launchMode="singleTask"
        android:theme="@android:style/Theme.Light.NoTitleBar"
        >
        <intent-filter >
              <action android:name="android.intent.action.MAIN" />    
             <category android:name="android.intent.category.HOME"/>    
            <category android:name="android.intent.category.DEFAULT" /> 
              <category android:name="android.intent.category.LAUNCHER" />  
        </intent-filter>
    </activity>