摘要: byte a = -1; int b = a; //b = -1; int c =a &&0xff; //c = 255; 区别:计算机存储的是补码 ,byte a = -1; //存储为1111 1111 强转会导致结果的值一样,所以int b = -1; //存储为11111111 111111 阅读全文
posted @ 2017-07-10 16:12 x-bing 阅读(484) 评论(0) 推荐(0) 编辑
摘要: 设置最大(最小)高度(宽度)时, 需要同时设置Android:adjustViewBounds="true",这样设置才会生效。 在代码中设置时,需要setAdjustViewBounds为true。一个layout的实例: android:adjustViewBounds="true" andro 阅读全文
posted @ 2017-07-05 13:57 x-bing 阅读(11673) 评论(0) 推荐(0) 编辑
摘要: 1 在使用EditText控件时,经常需要指定android:inputType属性,比如用户名输入框,密码输入框等。 而不同的android:inputType属性有时候会有使用不同的字体 EditText etPassword = findViewById(R.id.etPassword); e 阅读全文
posted @ 2017-07-04 11:25 x-bing 阅读(578) 评论(0) 推荐(0) 编辑
摘要: int a = 2000;String str = NumberFormat.getIntegerInstance(Locale.getDefault()).format(a); //转为千分符字符串System.out.println(str);try { int b = NumberFormat 阅读全文
posted @ 2017-06-26 11:22 x-bing 阅读(5847) 评论(0) 推荐(0) 编辑
摘要: LayoutInflate.inflate(int resourceId, ViewGroup root, boolean attachToRoot)三个参数含义: 首先明白下面知识点: 给控件所指定的layout_width和layout_height到底是什么意思?该属性的表示一个控件在容器中的 阅读全文
posted @ 2017-04-21 17:06 x-bing 阅读(1503) 评论(0) 推荐(1) 编辑
摘要: 1. Android事件分发是先传递到ViewGroup,再由ViewGroup传递到View的。 2. 在ViewGroup中可以通过onInterceptTouchEvent方法对事件传递进行拦截,onInterceptTouchEvent方法返回true代表不允许事件继续向子View传递,返回 阅读全文
posted @ 2017-04-21 15:23 x-bing 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 1.什么是序列化? 简单说就是为了保存在内存中的各种对象的状态,并且可以把保存的对象状态再读出来。虽然你可以用你自己的各种各样的方法来保存Object States,但是Java给你提供一种应该比你自己好的保存对象状态的机制,那就是序列化java源码中的解释:The serialization ru 阅读全文
posted @ 2017-04-17 17:36 x-bing 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Action:至少匹配一个 setAction(String)或者new Intent(String action); category:可以不添加匹配,但是如果添加必须匹配; addCategory(String categoru) 当没有添加时:系统会设置默认的category:android. 阅读全文
posted @ 2017-04-11 11:20 x-bing 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1、Android多国语言文件夹汇总 Arabic, Egypt (ar_rEG) —————————–阿拉伯语,埃及 Arabic, Israel (ar_rIL) ——————————-阿拉伯语,以色列 Bulgarian, Bulgaria (bg_rBG) ———————保加利亚语,保加利亚 阅读全文
posted @ 2017-03-31 19:00 x-bing 阅读(1296) 评论(0) 推荐(0) 编辑
摘要: 1.关闭install run 2.同时选中signature version中的v1和v2 阅读全文
posted @ 2017-03-31 10:19 x-bing 阅读(2437) 评论(1) 推荐(0) 编辑