如何在黑莓中设置西班牙语语言环境是我的代码及其给出错误,
我使用的是net.rim.device.api.i18n.Locale库
import net.rim.device.api.i18n.Locale;
import net.rim.device.api.i18n.SimpleDateFormat;
public static String formatDate(Date date)
{
String dateFormat = UserSettingManager.getUserSetting(UserSettingManager.PREF_DATE_FORMAT);
if(StringUtils.isEmptyOrWhitespace(dateFormat))
{
dateFormat = DEFAULT_DATE_FORMAT;
}
SimpleDateFormat formatter;
try
{
if(!isLanguageChangeToSpanish()){
formatter = new SimpleDateFormat(dateFormat);
}else {
formatter = new SimpleDateFormat(dateFormat, Locale.get(Locale.LOCALE_es, "es"));
}
}
catch(Exception e)
{
//If format received from server is wrong just display the default...
if(!isLanguageChangeToSpanish()){
formatter = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
}else {
formatter = new SimpleDateFormat(DEFAULT_DATE_FORMAT, Locale.get(Locale.LOCALE_es, "es"));
}
}
return formatter.format(date);
}
错误:找不到符号构造函数SimpleDateFormat(java.lang.String,net.rim.device.api.i18n.Locale)