货币根据Android的国家 [英] Currency According to Country in android

查看:166
本文介绍了货币根据Android的国家的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望根据当前GPS位置显示的货币符号。
我怎样才能做到这一点?
我使用低于code,但它总是$返回。

 列表<地址>地址=地理coder.getFromLocation(纬度,经度,1);
地址物镜= addresses.get(0);
货币立方厘米= Currency.getInstance(obj.getLocale());


解决方案

您使用以下获得象征货币?

  Currency.getInstance(obj.getLocale())getSymbol()。

是您obj.getLocale()一个有效的区域设置code以下 ISO_3166-1
ISO 639-1 的像de_DE这个。更进一步你放心,你为TestDevice支持所需的语言环境?
语言环境的详细信息,这里

I want to show Currency symbol according to current gps location. How can I do this? I am using below code but it always returns $.

List<Address> addresses = geocoder.getFromLocation(lat, lng, 1);
Address obj = addresses.get(0);
Currency cc=Currency.getInstance(obj.getLocale());

解决方案

Are you using the following to obtain the symbol for currency?

 Currency.getInstance(obj.getLocale()).getSymbol();

Is your obj.getLocale() a valid locale code following ISO_3166-1 and ISO 639-1 like "de_DE". Further more have you assured, that your testdevice supports the required locales? More information for locales here.

这篇关于货币根据Android的国家的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆