Hi,
i've developed an App with two activities - Main and Activity2 - and two differen icons and labels by insert this code in the Manifest Editor:
This is the result Manifest
The question is: can a program code hide and unhide only one of the two icons?
Mybe the way is to use Reflector and call "PackageManager" with method "setComponentEnabledSetting"?
Someone can explain how to do?
thanks
cb56
i've developed an App with two activities - Main and Activity2 - and two differen icons and labels by insert this code in the Manifest Editor:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetActivityAttribute(Main, android:icon, "@drawable/star")
SetActivityAttribute(Activity2, android:icon, "@drawable/stars")
SetActivityAttribute(Main, android:label, "B4a 1")
SetActivityAttribute(Activity2, android:label, "B4a 2")
AddActivityText(Activity2,
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>)
'End of default text.
This is the result Manifest
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="cb56.testtwoicons"
android:versionCode="1"
android:versionName="1"
android:installLocation="internalOnly">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="@drawable/icon"
android:label="Test 2 Icons">
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".main"
android:label="B4a 1"
android:screenOrientation="unspecified"
android:icon="@drawable/star">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:windowSoftInputMode="stateHidden"
android:launchMode="singleTop"
android:name=".activity2"
android:label="B4a 2"
android:screenOrientation="unspecified"
android:icon="@drawable/stars">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The question is: can a program code hide and unhide only one of the two icons?
Mybe the way is to use Reflector and call "PackageManager" with method "setComponentEnabledSetting"?
Someone can explain how to do?
thanks
cb56
Last edited: