android - 如何更改 Android 应用程序的启动器文本

标签 android xml android-launcher

我已经尝试更改我的 Android 应用程序的 Launcher 条目的文本,但它就是不起作用。人们建议从 AndroidManifest.xml 进行更改,但它对我不起作用。

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>

启动器中的应用程序入口

enter image description here

最佳答案

这是由于 LAUNCHER Activity 标签名称(android:label="@string/app_name" in <category android:name="android.intent.category.LAUNCHER" /> ) 在 Android Manifest 中,将其更改为您要为您的应用程序提供的名称。 你可以check this answer

所以,应用标签是没有用的。

AndroidMenifest.xml 中的代码更改为您的启动器 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>

关于android - 如何更改 Android 应用程序的启动器文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47813441/

相关文章:

android - 通过网络更新 Android 内容?

Android相机byte[]数组转2D数组

c# - 给定的路径格式不支持 c#

java - 列表未显示在屏幕上(Android Studio、Firebase)

java - 处理带有 XML 数据的传入 SOAPMessage 时出错

android - 从应用程序启动特定 Activity

android - 从原生访问插件的sqlite数据库

android - 在android studio中创建新项目时出错

android - 在 android nougat 启动器中删除 Hotseat (app dock)

android - 如何将我的应用程序设置为默认主页?