摘要: 1.在res/values下创建attrs.xml MyRadioButton为组件名字,随意起,attr标签定义组件的属性,name对应的是属性名,format是属性的类型,具体可参见《[Android]attrs.xml文件中属性类型format值的格式》。2.在自定义的组件中使用attrs.xml文件的定义public class MyRadioButton extends RadioButton { private String url; public MyRadioButton(Context context, AttributeSet attrs... 阅读全文
posted @ 2013-11-08 10:27 道奇兔 阅读(579) 评论(0) 推荐(0)
摘要: import java.io.ByteArrayInputStream;import java.io.ByteArrayOutputStream;import java.text.SimpleDateFormat;import java.util.Date;import android.app.Activity;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.os.Bundle;import android.os.Environment;import android.util 阅读全文
posted @ 2013-11-07 14:57 道奇兔 阅读(7041) 评论(0) 推荐(0)
摘要: /** * @param url * @return * @throws Exception */ private String getContent(String url) throws Exception{ StringBuilder sb = new StringBuilder(); HttpClient client = new DefaultHttpClient(); ////获取一个默认的HttpClient的对象实现 HttpParams httpParams = client.getParams(); ... 阅读全文
posted @ 2013-11-07 14:48 道奇兔 阅读(508) 评论(0) 推荐(0)
摘要: Android中AndroidManifest.xml警告Should explicitly set android:allowBackup to true or false (it's true by default, and that can have some security implications for the application's data)解决方案:android:allowBackup="true"android:allowBackup="false"http://developer.android.com/re 阅读全文
posted @ 2013-11-06 15:22 道奇兔 阅读(3740) 评论(0) 推荐(0)
摘要: Android图片裁剪开源代码,实现图片翻转,裁剪,可以自己定义调节裁剪比例,已经自定义裁剪框等.The Cropper is an image cropping tool. It provides a way to set an image in XML and programmatically, and displays a resizable crop window on top of the image. Calling the method getCroppedImage() will then return the Bitmap marked by the crop window. 阅读全文
posted @ 2013-10-31 15:40 道奇兔 阅读(236) 评论(0) 推荐(0)
摘要: 自定义实现区间范围选择。The RangeBar is similar to an enhanced SeekBar widget, though it doesn’t make use of the SeekBar. It provides for the selection of a range of values rather than a single value. The selectable range values are discrete values designated by tick marks; the thumb (handle) will snap to the n 阅读全文
posted @ 2013-10-31 15:35 道奇兔 阅读(364) 评论(0) 推荐(0)
摘要: 一丶最近项目开发在用Android Studio,不过无奈自动更新检查时总是提示”Connection failed. Please check your network connection and try again”。怀疑可能是因为“不可抗力”的原因,所以查了很多资料,终于找到了解决方法。在Android Studio安装目录/bin/studio.exe.vmoptions文件中追加以下几行-Djava.net.preferIPv4Stack=true-Didea.updates.url=http://dl.google.com/android/studio/patches/updat 阅读全文
posted @ 2013-10-30 12:00 道奇兔 阅读(802) 评论(0) 推荐(0)