2015-04-23 15 views
0

我正在使用xml字符串,並在android中默認使用「app_name」,但是當我使用它顯示我錯誤時,它會顯示包名。爲什麼我的字符串「app_name」在Android中顯示包名稱?

這是我在代碼中定義:

<string name="app_name">App's Name</string> 

而且在manifest.xml:

<application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:theme="@style/AppTheme" > 

但在Android告訴我的應用程序的名稱如何「br.com.enterprise。應用」

(我不能發佈圖片,因爲這是我的第一篇)

A中HAP另一件事筆是當我在另一款智能手機上安裝應用程序時,它顯示錯誤信息並關閉,我認爲原因是出於同樣的原因。

+2

在你的活動中,這個'android:label =「something」'是指什麼? – Raghunandan

+0

我沒有看到這個錯誤!謝謝 –

回答

3

你需要這樣的應用程序標籤指向的應用程序名稱,

<application 
    android:allowBackup="true" 
    android:label="@string/app_name" 
    android:icon="@drawable/ic_launcher" 
    android:theme="@style/AppTheme" > 

謝謝!

+1

謝謝!我失明瞭,我失去了2天! –

+0

好的歡迎!您還可以在您的啓動器活動中添加android:標籤...請接受我的回答,並加入它! – micky

0

要修復應用程序的名稱問題,請添加Label屬性以將字符串app_name鏈接到應用程序的名稱。

<application 
    android:allowBackup="true" 
    android:icon="@drawable/ic_launcher" 
    android:theme="@style/AppTheme" 
    android:label="@string/app_name"> 
相關問題