看板 AndroidDev 關於我們 聯絡資訊
※ 引述《lovelycateye (我還想要更多力量)》之銘言: : 在 res 內,由於大家的 string 或 drawable 命名一樣的時候。 : 有時候會發生會錯誤引用到別人的 res 的問題。 : 因此自己的 app 內的 res 在命名時最好避開建立專案時預設的那些名稱。 : 真實案例1: : Launcher Icon 在某些手機會莫名其妙變成預設的小綠人。 : 修改 ic_launcher.png 成別的名稱就好了。 : 真實案例2: : strings.xml 內的 App 名稱定為 app_name,在 Library Project 內也一樣。 : 因此 Launcher 上的名稱就變成 Library Project 的 app_name。 放上1的修正完 git status 結果 D res/drawable-hdpi/ic_launcher.png D res/drawable-ldpi/ic_launcher.png D res/drawable-mdpi/ic_launcher.png D res/drawable-xhdpi/ic_launcher.png ?? res/drawable-hdpi/ic_app_launcher.png ?? res/drawable-ldpi/ic_app_launcher.png ?? res/drawable-mdpi/ic_app_launcher.png ?? res/drawable-xhdpi/ic_app_launcher.png 以及AndroidManifest.xml 的 git diff 結果 diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 766b483..9d161e5 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -48,7 +48,7 @@ android:anyDensity="true" /> <application - android:icon="@drawable/ic_launcher" + android:icon="@drawable/ic_app_launcher" android:label="@string/application_name" android:theme="@android:style/Theme.Black.NoTitleBar" > <activity 只有少部分手機出現這問題,其實我也滿好奇這是啥巫術的。 至於2的話目前懶得重現,要說是沒做多國語言的 values 也是沒錯。 只是給偷懶的人一些建議,省得到時候慢慢找錯誤。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.251.144.84