本文整理汇总了Java中java.util.Currency.getAvailableCurrencies方法的典型用法代码示例。如果您正苦于以下问题:Java Currency.getAvailableCurrencies方法的具体用法?Java Currency.getAvailableCurrencies怎么用?Java Currency.getAvailableCurrencies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.Currency
的用法示例。
在下文中一共展示了Currency.getAvailableCurrencies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onViewCreated
import java.util.Currency; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
btn_find = (Button) view.findViewById(R.id.btn_find);
et_location_name = (EditText) view.findViewById(R.id.et_location_name);
et_country_code = (EditText) view.findViewById(R.id.et_country_code);
et_countyISO = (EditText) view.findViewById(R.id.et_countyISO);
et_currencyCode = (EditText) view.findViewById(R.id.et_currencyCode);
tv_currencySymbol = (TextView) view.findViewById(R.id.tv_currencySymbol);
tv_currencyDisplayName = (TextView) view.findViewById(R.id.tv_currencyDisplayName);
tv_currencyCode = (TextView) view.findViewById(R.id.tv_currencyCode);
tv_fractionDigits = (TextView) view.findViewById(R.id.tv_fractionDigits);
tv_numericCode = (TextView) view.findViewById(R.id.tv_numericCode);
tv_noDataFound = (TextView) view.findViewById(R.id.tv_noDataFound);
fl_bottomContents = (FrameLayout) view.findViewById(R.id.fl_bottomContents);
availableCurrenciesSet = Currency.getAvailableCurrencies();
currencyList = new ArrayList<>(availableCurrenciesSet);
btn_find.setOnClickListener(this);
}
示例2: isValidEnhet
import java.util.Currency; //导入方法依赖的package包/类
/**
* Validerer om riktig valuta enhet kommer fra brukeren
* @param valuta
* @return Valuta eller null
*/
public boolean isValidEnhet(String valuta) {
if (valuta != null) {
for (Currency c : Currency.getAvailableCurrencies()) {
if (c.getCurrencyCode().equals(valuta)) {
return true;
}
}
}
return false;
}