Multiple Alias Android Activity Icons
I have an Android app where I want to change the app icon. I know it can be done
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jordanzimmittidevelopers.com.communityservicelogger" >
// Allows Write To External Storage For Backup, Restore, And Print Features//
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
// Allows Phone To Vibrate//
<uses-permission android:name="android.permission.VIBRATE" />
// Basic Application Information//
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/RedTheme" >
// List Activity Information//
<activity
android:name=".ListActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity-alias
android:targetActivity=".ListActivity"
android:name=".OrangeTheme"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher_o"
android:enabled="false" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
// Theme Activity Information//
<activity
android:name=".ThemeChooser"
android:label="@string/title_activity_theme"
android:screenOrientation="portrait" >
</activity>
// New Event Activity Information//
<activity
android:name=".NewEvent"
android:label="@string/title_activity_new_event"
android:screenOrientation="portrait" >
</activity>
// Change Activity Information//
<activity
android:name=".Change"
android:label="@string/title_activity_change"
android:screenOrientation="portrait" >
</activity>
// Settings Activity Information//
<activity
android:name=".Settings"
android:label="@string/title_activity_settings"
android:screenOrientation="portrait" >
</activity>
// TutorialPage1 Activity Information//
<activity
android:name=".TutorialPage1"
android:label="@string/title_activity_tutorial_page1"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Holo.Light.NoActionBar" >
</activity>
// TutorialPage2 Activity Information//
<activity
android:name=".TutorialPage2"
android:label="@string/title_activity_tutorial_page2"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Holo.Light.NoActionBar" >
</activity>
// TutorialPage3 Activity Information//
<activity
android:name=".TutorialPage3"
android:label="@string/title_activity_tutorial_page3"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Holo.Light.NoActionBar" >
</activity>
// Print Activity Information//
<activity
android:name=".PrintEvents"
android:label="@string/title_activity_print_database" >
</activity>
// About Activity Information//
<activity
android:name=".About"
android:label="@string/title_activity_about" >
</activity>
</application>
</manifest>
It is disabled by default. I want the user to enable it on button click, so I have this code for my onClick for my button:
getPackageManager().setComponentEnabledSetting(
new ComponentName(this, ".ListActivity"),
PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
PackageManager.DONT_KILL_APP);
But when I click on the button, the force of the application is closed and I get the error:
java.lang.IllegalArgumentException: Component class .OrangeTheme does not exist at jordanzimmittidevelopers.com.communityservicelogger
Although it can be seen above in my manifest. Any idea what the problem is
Thanks you!
+3
source to share
No one has answered this question yet
Check out similar questions: