2013年12月17日
摘要: 2013-12-17有时候会发现在xml文件中有使用fragment,但是却不是为了显示View,代码如下: 1 6 7 13 14 20 21 可以看到上面xml文件中有LoadInXmlFragment,那我们来看看当进入和退出Activity时Activity和LoadInXmlFragment的生命周期, log如下: 1 // Enter Activity: 2 D/David-Activity( 7378): onCreate 3 D/David-Fragment( 7378): onAttach 4 D/David-Activity( 73... 阅读全文
posted @ 2013-12-17 11:44 wlrhnh 阅读(1583) 评论(0) 推荐(0) 编辑
摘要: 2013-12-171. 根据联系人图片Uri获得图片文件并将它显示在ImageView上, 代码如下: 1 Uri uri = Uri.parse("content://com.android.contacts/display_photo/1"); 2 AssetFileDescriptor afd; 3 try { 4 afd = getContentResolver().openAssetFileDescriptor(uri, "r"); 5 byte[] buffer = new byte[16 * 1024]; 6 Fi... 阅读全文
posted @ 2013-12-17 11:14 wlrhnh 阅读(3534) 评论(1) 推荐(0) 编辑