`
lisj10659
  • 浏览: 5447 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论
文章列表
android系统下带复选框的通讯录。代码为一个activity,需要的话自己写个launcher类型的activity用startActivity就能看到结果了。
众所周知,android平台的向下的兼容性并不好,很多新版本的android系统的api与低版本的并不一样,但是我们遇到的情况是android的app一般只有一个,不可能针对每一个版本开发一套app,好在谷歌公司还算人性化的提供了 Build.VERSION.SDK_INT这个常亮,会根据不同android版本有不同的值。以下为兼容安卓各个版本读取通讯录的demo Uri contentUri; String id_field; String name_field; String number_field; boolean newapi = Build.VERSION. ...
由于项目需要读取本机短信进行自动填充短信验证码,手上是一台nexus5 android5.0版本,一开始的代码如下:@SuppressLint("NewApi") public void BtnOnClick(View view){ ContentResolver cr = this.getContentResolver(); String[] projection = new String[] { "body","address" }; String where = "type=1 and address =& ...
INVISIBLE和GONE的主要区别是:当控件visibility属性为INVISIBLE时,界面保留了view控件所占有的空间;而控件属性为GONE时,界面则不保留view控件所占有的空间。 具体可参考http://blog.csdn.net/chindroid/article/details/8000713如下文章
[/color]最近遇到一个问题,就是Relativelayout用setBackgroundResource(int resid)设置图片作为背景时,图片失真,原因就是图片的长宽比不合适,而宽度又要填满整个手机宽度,造成图片压扁或者拉高如下: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width= ...
官方文档描述如下:A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updates. This class obeys the same functional specification as Hashtable, and includes versions of methods corresponding to each method of Hashtable. However, even though all operations are thread- ...
java中subSequence方法和subString的不同 返回的类型不一样,subString返回的是String类型,subSequence返回的是实现了CharSequence接口,subSequence得到的结果,只能有CharSequence中的方法。但是在String类中已经overWrite了subSequence,调用subSequence方法,可以向下转型为String类型。
Global site tag (gtag.js) - Google Analytics