本文整理匯總了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;
}