开发者

Can I retrieve a locale independent application label from the Android PackageManager?

开发者 https://www.devze.com 2022-12-17 20:33 出处:网络
I\'m using PackageManager.getApplicationLabel(ApplicationInf开发者_C百科o) to retrieve application labels.

I'm using PackageManager.getApplicationLabel(ApplicationInf开发者_C百科o) to retrieve application labels.

It looks like the label that is returned depends on the Locale set for the phone.

For instance with the music app I get "Music" in English, vs. "Musica" if I have my locale set to Spanish.

Is there a way to get the default application label (perhaps as defined in strings.xml)?

I want to be able to retrieve an application label for each app that is independent of locale.


There is no "application label for each app that is independent of locale" in Android. After all, in your own application, you will notice that you are not providing such a label.

I would flip the question around: what is there that you are putting in AndroidManifest.xml that would meet your needs? Then, find out how to access that data from the PackageManager.

0

精彩评论

暂无评论...
验证码 换一张
取 消