多个图标活动别名Android

时间:2015-05-20 22:04:41

标签: android

我有一个Android应用程序,我希望更改应用程序图标。我知道这可以通过制作一个

<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>

默认情况下禁用。我希望用户在按钮单击时启用它,所以我的onClick for my按钮有这个代码:

getPackageManager().setComponentEnabledSetting(
                new ComponentName(this, ".ListActivity"),
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,    
PackageManager.DONT_KILL_APP);

但是当我点击按钮时,app force关闭,我收到错误:

  

java.lang.IllegalArgumentException:Component class .OrangeTheme   不存在于jor​​danzimmittidevelopers.com.communityservicelogger

即使如上所见,它也在我的清单中。知道问题是什么

谢谢你!

0 个答案:

没有答案