2013年4月12日

数字锁

摘要: 先设置监听事件private void edit_pass() { tw = new TextWatcher() { // @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } // @Override public void onTextChanged(CharSequence s, int start, int before, int count) { Log.w("Log", "----" + s); } ... 阅读全文

posted @ 2013-04-12 17:38 _star 阅读(198) 评论(0) 推荐(0)

String类

摘要: 方法摘要static CharSequence返回一个字符序列commaEllipsize(CharSequence text,TextPaint p, float avail,String oneMore,String more) Converts a CharSequence of the comma-separated form "Andy, Bob, Charles, David" that is too wide to fit into the specified width into one like "Andy, Bob, 2 more". 阅读全文

posted @ 2013-04-12 14:18 _star 阅读(238) 评论(0) 推荐(0)

2013年4月9日

WebView

摘要: html页面的按钮点击无效,因为webview外层嵌套了scrollVeiw 失去焦点造成 阅读全文

posted @ 2013-04-09 16:25 _star 阅读(152) 评论(0) 推荐(0)

2013年4月8日

tabActivity

摘要: <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:layout_width="match_parent" android:layou 阅读全文

posted @ 2013-04-08 09:50 _star 阅读(188) 评论(0) 推荐(0)

2013年4月2日

java map

摘要: Map是java中的接口,Map.Entry是Map的一个内部接口。Map提供了一些常用方法,如keySet()、entrySet()等方法,keySet()方法返回值是Map中key值的集合;entrySet()的返回值也是返回一个Set集合,此集合的类型为Map.Entry,//个人理解entrySet()就是Map项列表。Map.Entry是Map声明的一个内部接口,此接口为泛型,定义为Entry<K,V>。它表示Map中的一个实体(一个key-value对)。接口中有getKey(),getValue方法。由以上可以得出,遍历Map的常用方法:1.Mapmap=newHas 阅读全文

posted @ 2013-04-02 13:53 _star 阅读(218) 评论(0) 推荐(0)

2013年4月1日

bitmap 缩放

摘要: 安卓开发中应用到图片的处理时候,我们通常会怎么缩放操作呢,来看下面的两种做法: 方法1:按固定比例进行缩放 在开发一些软件,如新闻客户端,很多时候要显示图片的缩略图,由于手机屏幕限制,一般情况下,我们取图片的缩略图,取缩略图的方法我们可以使用BitmapFactory的decodeFile方法,然后通过传递进去 BitmapFactory.Option类型的参数进行取缩略图,在Option中,属性值inSampleSize表示缩略图大小为原始图片大小的几分之一,即如果这个值为2,则取出的缩略图的宽和高都是原始图片的1/2,图片大小就为原始大小的1/4。但是,如果我们想取固定大小的缩略图就... 阅读全文

posted @ 2013-04-01 16:31 _star 阅读(778) 评论(0) 推荐(0)

获取存储

摘要: Android很多手机现在都有EMMC存储(一般是2G),一些手机并没有挂载在getExternalStorageDirectory()这个节点上(该节点用于挂载外部sdcard了).而是挂载到"/mnt/emmc"节点上,另外一些手机把EMMC存储直接挂载到了getExternalStorageDirectory() 这个节点上,而对于真正的外部sdcard挂载到了"/mnt/sdcard2"这个节点上。另外/system/etc/vold.fstab文件中描述了SD card的挂载点,我们可以读取它来得到关于SD card的挂载点信息。因此当我们存储 阅读全文

posted @ 2013-04-01 12:56 _star 阅读(390) 评论(0) 推荐(0)

2013年3月29日

Android zip

摘要: /** * Java utils 实现的Zip工具 * * @author once */public class ZipUtils { private static final int BUFF_SIZE = 1024 * 1024; // 1M Byte /** * 批量压缩文件(夹) * * @param resFileList 要压缩的文件(夹)列表 * @param zipFile 生成的压缩文件 * @throws IOException 当压缩过程出错时抛出 */ public static void zipFil... 阅读全文

posted @ 2013-03-29 15:14 _star 阅读(279) 评论(0) 推荐(0)

2013年3月27日

Bitmap回收异常

摘要: 今天遇到Canvas: trying to use a recycled bitmap android.graphics.Bitmap问题我这用到bitmap中间变量了,还用到Bitmap bitmap = Bitmap.createBitmap(temp, 0, 0, width, height, matrix,true);方法了。把temp.recycle();后就报了那个错误。原因是传入的temp图片和新的bitmap图片分辨率一样。createBitmap的源码就会直接返回temp对象,而不是新建一个bitmap对象,这样temp.recycle()被回收后,bitmap自然也被回收了 阅读全文

posted @ 2013-03-27 10:13 _star 阅读(322) 评论(0) 推荐(0)

Android的图片压缩类ThumbnailUtils

摘要: Android 2.2之后ThumbnailUtils类1、图片创建一个指定大小的缩略图extractThumbnail(source,width,height):2、视频createVideoThumbnail(filePath,kind): 阅读全文

posted @ 2013-03-27 10:12 _star 阅读(259) 评论(0) 推荐(0)

导航