2013年12月10日

动态代理(Proxy)的一种简便实现

摘要: import java.lang.reflect.InvocationHandler;import java.lang.reflect.Method;import java.lang.reflect.Proxy;/** * (一切从接口开始) * @author 硬度 * */interface Movable { void move(int speed);}/** * 坦克类 * * @author 硬度 * */class Tank implements Movable { @Override public void move(int speed) { System.out.pri... 阅读全文

posted @ 2013-12-10 05:56 硬度 阅读(146) 评论(0) 推荐(0)

2013年11月22日

获得从图库中选取的图片的物理路径

摘要: /** * 解析从图库中选取的图片Uri,获得图片的物理路径 * * @param imageUri * 从图库中选取的图片Uri * @return 图片的物理路径(String) */ public static String getImagePath(Context context, Uri imageUri) { String path = null; Cursor cursor = context.getContentResolver().query(imageUri, null, null, null, null); // 查询所有字段 if (cursor... 阅读全文

posted @ 2013-11-22 12:25 硬度 阅读(265) 评论(0) 推荐(0)

2013年11月18日

关于更新百度地图库2.30后一个重要的小BUG

摘要: 以前在用MKSearch查询,监听回调,加进图层,一般是用invalidate()刷新地图(mapView),现在好象无效,要用refresh()! 阅读全文

posted @ 2013-11-18 12:12 硬度 阅读(327) 评论(0) 推荐(0)

导航