tucano2000 Active Member Licensed User Longtime User May 19, 2014 #1 I need to change the launcher icon and label of my app to Pro version. Is possible ? I found this for Java but i don´t know to translate to B4A : 1 . Modify your MainActivity section in AndroidManifest.xml, delete from it, line with MAIN category in intent-filter section Code: Copy <activity android:name="ru.quickmessage.pa.MainActivity" android:configChanges="keyboardHidden|orientation" android:screenOrientation="portrait" android:label="@string/app_name" android:theme="@style/CustomTheme" android:launchMode="singleTask"> <intent-filter> ==> <action android:name="android.intent.action.MAIN" /> <== Delete this line <category android:name="android.intent.category.LAUNCHER" />//DELETE THIS LINE </intent-filter> </activity> 2 . Create <activity-alias>, for each of your icons. Like this Code: Copy <activity-alias android:label="@string/app_name" android:icon="@drawable/icon" android:name=".MainActivity-Red" android:enabled="false" android:targetActivity=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity-alias> 3 . Set programmatically: set ENABLE attribute for the appropriate activity-alias Code: Copy getPackageManager().setComponentEnabledSetting( new ComponentName("ru.quickmessage.pa", "ru.quickmessage.pa.MainActivity-Red"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); Source: http://stackoverflow.com/questions/...-application-icon-programmatically-in-android In B4A I think it is necessary to change only step 3. Anyone know how to do this? I'm Brazilian...Sorry my bad english. Last edited: May 20, 2014
I need to change the launcher icon and label of my app to Pro version. Is possible ? I found this for Java but i don´t know to translate to B4A : 1 . Modify your MainActivity section in AndroidManifest.xml, delete from it, line with MAIN category in intent-filter section Code: Copy <activity android:name="ru.quickmessage.pa.MainActivity" android:configChanges="keyboardHidden|orientation" android:screenOrientation="portrait" android:label="@string/app_name" android:theme="@style/CustomTheme" android:launchMode="singleTask"> <intent-filter> ==> <action android:name="android.intent.action.MAIN" /> <== Delete this line <category android:name="android.intent.category.LAUNCHER" />//DELETE THIS LINE </intent-filter> </activity> 2 . Create <activity-alias>, for each of your icons. Like this Code: Copy <activity-alias android:label="@string/app_name" android:icon="@drawable/icon" android:name=".MainActivity-Red" android:enabled="false" android:targetActivity=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity-alias> 3 . Set programmatically: set ENABLE attribute for the appropriate activity-alias Code: Copy getPackageManager().setComponentEnabledSetting( new ComponentName("ru.quickmessage.pa", "ru.quickmessage.pa.MainActivity-Red"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); Source: http://stackoverflow.com/questions/...-application-icon-programmatically-in-android In B4A I think it is necessary to change only step 3. Anyone know how to do this? I'm Brazilian...Sorry my bad english.
Erel B4X founder Staff member Licensed User Longtime User May 20, 2014 #2 See the comments for this answer. It doesn't work reliably. Upvote 0
tucano2000 Active Member Licensed User Longtime User May 20, 2014 #3 This is true Erel, I had not seen! Thanks for now. I'll just change the shortcut icon. Upvote 0