Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the localized label of the phone types?

When changing the custom locale the label of the phone types change to the appropriate language. Does anybody know how to get the localized label of the phone types?

I pick a contact in my app to get its phone number and if there is more then one number I use an AlertDialog to let the user select the currect one. In this pick list, I want to show the label of the type, so it's easier for the user to select. Since they labels are somewhere in the Android system, it must be possible to get the localized label. Unfortunately, the Phone.LABEL is null when reading the phone number.

like image 479
infero Avatar asked Aug 24 '10 18:08

infero


1 Answers

I know this is a bit old, but this:

Phone.getTypeLabel(this.getResources(), cursor.getInt(typeIdx), "");

worked for me

like image 199
James Dunham Avatar answered Oct 20 '22 21:10

James Dunham