One android application, one startup view, two icons

送分小仙女□ 提交于 2019-12-24 03:41:12

问题


I have one application, one startup view, two app icons and two app names.

I have to work with two app names and icons, it's crucial. The app it's the same.

The name and the icon changes with different signature type. free and not free signature.

I have two different icons and two different names for my app. And i want to change that in my java code. it's possible? Or change that in apk generation without change manifest file all the time.

I have icon1.png and icon2.png in drawable-hdpi/.


回答1:


You could automate the different builds using an ANT build.xml file with parameters. There are several examples on how to do this for Android in Google.




回答2:


Sure, you have to go to the Manifest file and look out for:

<activity
            android:name=".Activity1"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

Please ignore the names, you will find your activity names.

The activity you want to use as the first activity should be as it is. But the activity which you do not want to show up in the launcher needs to be edited like:

<activity
                android:name=".Activity2"
                android:label="@string/title_activity_main" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />


                </intent-filter>
            </activity>

the <category android:name="android.intent.category.LAUNCHER" /> should be removed.

This will create only one icon and one name

<android:label="@string/title_activity_main">

Change the label please



来源:https://stackoverflow.com/questions/13491909/one-android-application-one-startup-view-two-icons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!