1

How can I have 2 icons for 2 main activities? I have 2 main/launcher activities. each of those have its own icon. All is ok, but sometimes users say that after update - the icon get mixed. they get 2 times the same icon.

<activity android:name="com.test.testpackacge.activity"
        android:theme="@style/AppTheme.NoActionBar"
        android:icon="@mipmap/icon"
        android:roundIcon="@mipmap/ic_icon_round"
        android:label="@string/app_label_gallery"
        android:configChanges="orientation|screenSize|keyboardHidden"
        android:launchMode="singleTask"
        android:taskAffinity="com.test.testpackacge.activity"

        >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
   </activity>

<activity android:name="com.test.testpackacge.activity2"
        android:icon="@mipmap/icon2"
        android:roundIcon="@mipmap/icon2_round"
        android:launchMode="singleTask"
        android:label="@string/app_label"
        android:theme="@style/AppTheme.NoActionBar"
        android:windowSoftInputMode="stateHidden|adjustResize"
        android:taskAffinity="com.test.testpackacge.activity2">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>
    </activity>

Will adding Default to the main activity will help?

 <category android:name="android.intent.category.DEFAULT"/>

Should I consider flavor? or 2 manifests?

kfir
  • 635
  • 8
  • 27
  • 1
    `android.intent.category.DEFAULT` means an Activity can be launched using implicit intents. I don't think that solves your problem. – Arrowsome May 30 '20 at 12:45
  • 1
    Apps that declare two MAIN activities are not very common. Possible that the developer(s) of the launcher app have not tested this situation and therefore mix up the icons? Ask for the used launcher when ever you get a bug report for the mixed-up icons. – Robert May 30 '20 at 13:48
  • Dear Robert, You ask if the mix is already in the manifest? no, I have double checked. it is like I have written. I have tested it many times. the mix happens only rarely and only after users updates. deleting and submitting the icons again to the launcher solves the problem until next update. If you recommend other method of having 2 launcher icons to activate 2 different activities - I will be happy to hear. – kfir May 30 '20 at 14:12

0 Answers0