1、android:password is deprecated: Use inputType instead

android:password="true"
更改为:
android:inputType="textPassword"


2、missing contentdescription attribute on image
ADT 16.0的新特性,在一些没有文本显示的控件里,如imageView和imageButton等,ADT会提示你定义一个android:contentDescription属性

3、android弹窗
http://blog.csdn.net/centralperk/article/details/7493731

4、RadioGroup中的RadioButton分别都要设置自己的id,这样就可以互斥选择了

5、选中RadioGroup选中的值
RadioButton radiobtn = (RadioButton) settingLang.findViewById(settingLang.getCheckedRadioButtonId());
int radioInt = Integer.parseInt(radiobtn.getTag().toString());

6、设置语种切换
1、各国语言缩写-各国语言简称,世界各国域名缩写
http://blog.csdn.net/snlei/article/details/3788925
2、在工程res文件下添加对应语种的values文件 eg:values-en
3、
//应用内配置语言
Resources resources =getResources();//获得res资源对象
Configuration config = resources.getConfiguration();//获得设置对象
DisplayMetrics dm = resources.getDisplayMetrics();//获得屏幕参数:主要是分辨率,像素等。
config.locale = Locale.SIMPLIFIED_CHINESE; //简体中文
resources.updateConfiguration(config, dm);
4、设置跳转后才会切换语种
// Intent intent = getIntent();
// finish();
// startActivity(intent);

5、如果没有的语种可以直接new
config.locale =new Locale("ar");
7、在代码中设置RadioGroup的默认选中
RadioGroup.check(R.id.setting_lang_en);

8、保存值到对应资源文件中
8.1
SharedPreferences的四种操作模式:
Context.MODE_PRIVATE
Context.MODE_APPEND
Context.MODE_WORLD_READABLE
Context.MODE_WORLD_WRITEABLE

Context.MODE_PRIVATE:为默认操作模式,代表该文件是私有数据,只能被应用本身访问,在该模式下,写入的内容会覆盖原文件的内容
Context.MODE_APPEND:模式会检查文件是否存在,存在就往文件追加内容,否则就创建新文件.
Context.MODE_WORLD_READABLE和Context.MODE_WORLD_WRITEABLE用来控制其他应用是否有权限读写该文件.
MODE_WORLD_READABLE:表示当前文件可以被其他应用读取.
MODE_WORLD_WRITEABLE:表示当前文件可以被其他应用写入.

8.2
将数据保存至SharedPreferences:
SharedPreferences preferences=getSharedPreferences("user",Context.MODE_PRIVATE);
Editor editor=preferences.edit();
String name="xixi";
String age="22";
editor.putString("name", name);
editor.putString("age", age);
editor.commit();

从SharedPreferences获取数据:
SharedPreferences preferences=getSharedPreferences("user", Context.MODE_PRIVATE);
String name=preferences.getString("name", "defaultname");
String age=preferences.getString("age", "0");

更多相关文章

  1. C语言函数以及函数的使用
  2. 二十四、Android文件的读写
  3. Android初级教程理论知识(第二章布局&读写文件)
  4. Android 文件读写最全解析
  5. android 多语言实现总结
  6. android学习之textView布局文件

随机推荐

  1. android的消息处理机制(图+源码分析)——Lo
  2. Android Studio 3.6 特征大揭秘
  3. android 面试题二
  4. Android复制assets目录下的图片到内存
  5. android 命令行安装apk
  6. android之使用signapk打包成系统应用,获取
  7. osg for android 学习之十:注意事项
  8. 解决 android GIF播放的问题
  9. android多apk共享私有文件
  10. Android(安卓)数据库sqlite