封装http请求类,利用回调机制获取返回值 public interface HttpCallbackListener { void onFinish(String response); void onError(Exception e); } public class HttpUtil { public static void sendHttpRequest(final String address, final HttpCallbackListener listener){ new Thre…
View宽高测量方法: 测量方法有三种,如下: 1)(直接在onCreate()执行) int w = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED); int h = View.MeasureSpec.makeMeasureSpec(0,View.MeasureSpec.UNSPECIFIED); imageView.measure(w, h); int height =imageView.getMeasured…