摘要: String str = String.format("00 : %s", String.format("%02d", time));批处理得到电脑ip:@echo offfor /f "tokens=2 delims=:" %%i in ('ipconfig^|findstr "IPv4 地址"'... 阅读全文
posted @ 2015-10-08 15:35 张小宝的博客 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Environment.getExternalStorageState:mounted Environment.getDownloadCacheDirectory().getPath():/cache Environment.getDataDirectory().getPath():/data En... 阅读全文
posted @ 2015-04-30 15:56 张小宝的博客 阅读(372) 评论(0) 推荐(0) 编辑
摘要: onNewIntent调用时机 在IntentActivity中重写下列方法:onCreate onStart onRestart onResume onPause onStop onDestroy onNewIntent一、其他应用发Intent,执行下列方法:I/@@@philn(12410):... 阅读全文
posted @ 2015-03-30 11:38 张小宝的博客 阅读(1986) 评论(0) 推荐(0) 编辑
摘要: 在Android项目中使用到了org.apache.commons.codec.jar包下的Hex.encodeHexString(byte[] input)方法进行加密。结果编译通过,运行时总是报java.lang.NoSuchMethodError: org.apache.commons.cod... 阅读全文
posted @ 2015-03-18 23:01 张小宝的博客 阅读(695) 评论(0) 推荐(0) 编辑
摘要: 查看.log文件,错误日志如下:!MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown:解决... 阅读全文
posted @ 2015-03-06 14:37 张小宝的博客 阅读(211) 评论(0) 推荐(0) 编辑
摘要: cmd打开dos窗口输入keytool -list -v -keystore "C:\Users\jack\.android\debug.keystore"输入密钥库口令,默认为空,直接enter。得到debug.keystore的SHA1密文,默认为59:EC:E4:95:7C:77:6C:FA:... 阅读全文
posted @ 2015-02-13 16:42 张小宝的博客 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1.界面比较多,并且很多界面的背景图片不一样;2.涉及到换肤功能,定义多种皮肤,皮肤的资源不是使用color 而是图片资源;以上两种情况,如果不注意合理释放内存,将会发生OOM。我们在android程序中,无论是使用layout布局设置了背景还是使用了setBackgroundResource 设置... 阅读全文
posted @ 2014-10-22 19:03 张小宝的博客 阅读(4518) 评论(0) 推荐(0) 编辑
摘要: Map map = new HashMap(); @Override public View getView(int position, View convertView, ViewGroup parent) { View view; ViewHolde... 阅读全文
posted @ 2014-10-17 18:40 张小宝的博客 阅读(1330) 评论(0) 推荐(0) 编辑
摘要: 一.图片的存在形式1.文件形式(即以二进制形式存在于硬盘上)2.流的形式(即以二进制形式存在于内存中)3.Bitmap形式这三种形式的区别:文件形式和流的形式对图片体积大小并没有影响,如果你手机SD卡上的如果是100K,那么通过流的形式读到内存中,也一定是占100K的内存。当图片以Bitmap的形式... 阅读全文
posted @ 2014-10-14 11:26 张小宝的博客 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 在Android开发中有时候需要将ImageView和TextView作为一个整体显示出来,并能动态更改ImageView的图片和TextView的文字。此时一般有两种做法。方法一:自定义组合控件:public class CustomImageText extends LinearLayout {... 阅读全文
posted @ 2014-10-11 12:10 张小宝的博客 阅读(343) 评论(0) 推荐(0) 编辑