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. 设置Android(安卓)app背景图片(Android(安卓)studio)
  2. Android(安卓)in Practice笔记第二章
  3. 让Android支持透明状态栏
  4. Android布局优化(四)X2C — 提升布局加载速度200%
  5. android布局文件中各属性所代表的意义
  6. android:layout_gravity和android:gravity属性的区别
  7. Android样式基础--shape篇
  8. Android中的一些样式设置
  9. Android(安卓)Jni代码示例讲解

随机推荐

  1. Android——布局的一些动态设置
  2. Android中ListView最简单的用法
  3. Google用户登录界面 Android实现
  4. Android(安卓)下保持屏幕常亮
  5. Android调用系统的发邮件方法
  6. Android(安卓)SQLite数据库相关操作
  7. Android(安卓)or java https ssl excepti
  8. Android客户端连接服务器
  9. Android(安卓)沉浸式状态栏跟虚拟按键冲
  10. TabLayout属性及自定义底部导航栏