Change Application name and launcher icon runtime.

Changing an application name and application icon from the application.

For that we need to use the <activity-alias>. This tag will be in manifest inside <application> tag.

An alias for an activity, named by the targetActivity attribute. The target must be in the same application as the alias and it must be declared before the alias in the manifest.

The alias presents the target activity as a independent entity. It can have its own set of intent filters, and they, rather than the intent filters on the target activity itself, determine which intents can activate the target through the alias and how the system treats the alias. For example, the intent filters on the alias may specify the “android.intent.action.MAIN” and “android.intent.category.LAUNCHER” flags, causing it to be represented in the application launcher, even though none of the filters on the target activity itself set these flags.

With the exception of targetActivity, <activity-alias> attributes are a subset of <activity> attributes. For attributes in the subset, none of the values set for the target carry over to the alias. However, for attributes not in the subset, the values set for the target activity also apply to the alias.

Source code Download Here

 

One thought on “Change Application name and launcher icon runtime.

  1. unfortunately with this approach, app won’t launch from recent apps.

    but the textra app solve this, how?

    how this problem can be solved?

Leave a Reply

Your email address will not be published. Required fields are marked *