摘要: 解决办法如下: public void setListViewHeightBasedOnChildren(ListView listView) { // 获取ListView对应的Adapter ListAdapter listAdapter = list... 阅读全文
posted @ 2014-06-16 10:55 雪地深处 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 今天升级了小米系统之后,突然发现连到电脑上总显示设备offline,原因是adb的版本低,不支持新的系统(我的版本是4.1.2)。然后更新platform-tools 更新过程各种xxx,超级缓慢。不过更新之后还是好了。再次连接手机会询问是否允许usb调试,允许即可。 阅读全文
posted @ 2014-01-10 10:14 雪地深处 阅读(598) 评论(0) 推荐(0) 编辑
摘要: https://democome.com 看网上说是吧my.ini中的这段代码改成utf8 改成utf8之后还是不行,后来找到一篇文章帮助解决 http://database.51cto.com/art/201107/279004.htm MySQL数据库默认编码已经是utf8了, default- 阅读全文
posted @ 2013-12-28 16:05 雪地深处 阅读(1039) 评论(0) 推荐(0) 编辑
摘要: 遇到一个无法创建数据库表的问题,Can't create table '.\xxx\xxx.frm' 看网上说是因为数据库有外键关联,但是我的数据库没有外键,后来试了一下 先drop database 之后再重新创建数据库和表就可以了,原因是删除数据库的时候直接去数据库所在的文件夹直接删除了,删除的时候最好用语句删除,否则容易出现数据库删不干净的问题。 阅读全文
posted @ 2013-12-23 14:22 雪地深处 阅读(1225) 评论(0) 推荐(0) 编辑
摘要: 昨天做项目遇到上传图片的问题,服务端提供的接口如下, 1 /*** 2 * 上传文件 3 * @param file 文件对象 4 * @param filename 重命名 5 * @return uuid 服务器文件的唯一标识,之后用于下载 6 * @throws HttpException 7 * @throws IOException 8 */ 9 public static String upload(File file, String filename) throws HttpExcepti... 阅读全文
posted @ 2013-09-05 09:10 雪地深处 阅读(493) 评论(0) 推荐(0) 编辑
摘要: 1、手机内存已用和可用空间 1 private String[] getPhoneMemory() { 2 String[] result = {"",""}; //1-total 2-avail 3 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); 4 ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); 5 6 ... 阅读全文
posted @ 2013-09-02 23:05 雪地深处 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 1、创建快捷方式 public void checkShortCut() { SharedPreferences sp = PreferenceManager .getDefaultSharedPreferences(this); // 是否在桌面上添加了快捷方式 boolean never_check_shortCut = sp.getBoolean("never_check_shortCut", false); // 存在快捷方式或者不允许添加,return ... 阅读全文
posted @ 2013-09-02 22:59 雪地深处 阅读(217) 评论(0) 推荐(0) 编辑
摘要: (转)http://www.apkbus.com/forum.php?mod=viewthread&tid=127469[正则表达式]文本框输入内容控制整数或者小数:^[0-9]+\.{0,1}[0-9]{0,2}$只能输入数字:"^[0-9]*$"。只能输入n位的数字:"^\d{n}$"。只能输入至少n位的数字:"^\d{n,}$"。只能输入m~n位的数字:。"^\d{m,n}$"只能输入零和非零开头的数字:"^(0|[1-9][0-9]*)$"。只能输入有两位小数的正实数:" 阅读全文
posted @ 2013-08-31 16:41 雪地深处 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 做项目系统退出时,直接调用系统的AlertDialog感觉太难看了,于是自己定义了一番,直接上代码。1、自定义类MyDialog继承Dialog 1 public class MyDialog extends Dialog { 2 3 public MyDialog(Context context, int theme) { 4 super(context, theme); 5 } 6 7 public MyDialog(Context context) { 8 super(context); 9 } 1... 阅读全文
posted @ 2013-08-31 16:37 雪地深处 阅读(310) 评论(0) 推荐(0) 编辑
摘要: window->preference->java->code styple->code template 当你选择到这部的时候就会看见右侧有一个框显示出code这个选项,你点开这个选项,点一下他下面的New Java files 然后你点edit按钮,把他的内容换成你的就可以了:(例如)${filecomment}${package_declaration}/*** @author ypeng* @version 创建时间:${date} ${time}* 类说明*/${typecomment}${type_declaration} 阅读全文
posted @ 2013-08-31 16:27 雪地深处 阅读(369) 评论(0) 推荐(0) 编辑