flash76
flash76

Reputation: 382

How to Change Android App's Launcher Text

I have tried changing the text of the Launcher entry of my Android app, but it's just not working. People recommend changing from AndroidManifest.xml but it's not working for me.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.reliefdev.reliefdevedworking">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/ReliefSignatureTheme">
        <activity
            android:name=".WelcomeActivity"
            android:label="@string/welcome_action_bar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".LoginReliefAccountActivity"
            android:label="@string/login_action_bar" />
        <activity android:name=".CreateReliefAccountActivity"></activity>
    </application>

</manifest>

strings.xml

<resources>
    <string name="app_name">Relief</string>
    <string name="button_started">Get Started</string>
    <string name="welcome_action_bar">Welcome</string>
    <string name="welcome_desc">Welcome to Relief Donate. Save and help lives, all with the touch of a button.\n\nYour donation counts.</string>
    <string name="welcome_title">Oh hello!</string>

    <string name="login_action_bar">Login</string>
    <string name="login_title">Login to your Relief Account</string>
    <string name="login_desc">So we can keep track of your donations \n(and honorable mentions!)</string>
    <string name="signup_edittext_uname_hint">kindsoul2113 (username)</string>
    <string name="signup_edittext_pwd_hint">password (password - please don\'t use "password" as your password)</string>
    <string name="btn_create_account_text">Sign Up</string>
    <string name="btn_login_text">Log In</string>
    <string name="or">OR...</string>
</resources>

application entry in the launcher

enter image description here

Upvotes: 1

Views: 1911

Answers (2)

Amit Vaghela
Amit Vaghela

Reputation: 22965

This is due to LAUNCHER activity label name(android:label="@string/app_name" in <category android:name="android.intent.category.LAUNCHER" />) in Android Manifest, change it to name you want to give for your application. you can check this answer

So, application label is of no use.

Change code as shown below, in AndroidMenifest.xml to your launcher Activity

        <activity
            android:name="WelcomeActivity"
            android:launchMode="singleInstance"
            android:label="@string/app_name"    // write here your application name
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

Upvotes: 2

Jyubin Patel
Jyubin Patel

Reputation: 1373

Changing an application name and application icon from the application.

For that we need to use the . This tag will be in manifest inside tag.

<activity-alias android:enabled=["true"|"false"]
android:exported=["true"|"false"]
android:icon="drawable"
android:label="string resource"
android:name="string resource"
android:permission="string resource"
android:targetActivity="string resource">

</activity-alias>

With the exception of targetActivity, attributes are a subset of 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.

getPackageManager().setComponentEnabledSetting(new ComponentName("com.sid.appiconlauncher", "com.sid.appiconlauncher.MainActivity-Red"),

PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);

    try {
        getPackageManager().setComponentEnabledSetting( new ComponentName("com.sid.appiconlauncher", "com.sid.appiconlauncher.MainActivity-Green"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
        getPackageManager().setComponentEnabledSetting( new ComponentName("com.sid.appiconlauncher", "com.sid.appiconlauncher.MainActivity-Blue"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
    } catch (Exception e) {
        e.printStackTrace();
    }

if you don't understand then refer below Link :

https://github.com/shabbir-dhangot/Application-Launcher-Icon-And-Name-Changer

hope this works for you.

Upvotes: 1

Related Questions