1.(2012-1-16)动态设置EditText为密码形式。
解答:因为没有setPassword()或者像setPhoneNumber()这样的函数,所以有必要找到解决的方法。
实际上,是通过edittext.setTransformationMethod(HideReturnsTransformationMethod.getInstance();来设置显示明文;通过setTransformationMethod(PasswordTransformationMethod.getInstance();来显示密码。
2.在程序中动态改变语系和其他配置。
解答:
- Resources resources = getResources();
- Configuration configuration = resources.getConfiguration();
- configuration.locale = Locale.CHINESE;
- DisplayMetrics dm = resources.getDisplayMetrics();
- resources.updateConfiguration(configuration, dm);