Android Get Country Emoji Flag Using Locale

后端 未结 6 2066
难免孤独
难免孤独 2021-01-04 05:31

I have seen that since Lollipop, Android has built in Emoji flags for different countries. Is it possible to use the devices locale to retrieve the

6条回答
  •  失恋的感觉
    2021-01-04 05:49

    You can get the country code very simple. I want to talk about flag selection according to country code.

    I wrote a class about it and it is very simple to use.

    usage:

    String countryWithFlag = CountryFlags.getCountryFlagByCountryCode("TR") + " " + "Türkiye";
    

    Output :

提交回复
热议问题