代码改变世界

随笔档案-2011年01月

启动Activity

2011-01-25 16:41 by cppguy, 371 阅读, 收藏,
摘要: adb shell am start -n 应用包名/应用入口(MAINActivity) 阅读全文

MediaScanner

2011-01-25 13:14 by cppguy, 1357 阅读, 收藏,
摘要: 原作者:Steve Gou 转载请注明! 下面是系统 图 MediaScannerReceiver 会在任何的 ACTION_BOOT_COMPLETED, ACTION_MEDIA_MOUNTED 或 ACTION_MEDIA_SCANNER_SCAN_FILE 意图( intent )发出的时候启动。因为解析媒体文件 的元数据 或许会需要很长时间 ,所以 MediaScannerReceiver 会启动 MediaScannerService 。 MediaScannerService 调用一个公用类 MediaScanner 去处理真正的工作。 MediaScannerReceiv 阅读全文

HashMap遍历的两种方式

2011-01-21 15:05 by cppguy, 412 阅读, 收藏,
摘要: 第一种: Map map = new HashMap(); Iterator iter = map.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); Object key = entry.getKey(); Object val = entry.getValue(); } 效率高,以后一定要使用此种方式! 第二种: Map map = new HashMap(); Iterator iter = map.keySet().iterator(); while 阅读全文

Ubuntu9.10编译Android2.2错误需修复

2011-01-17 13:25 by cppguy, 637 阅读, 收藏,
摘要: 关于android源码编译的资料网上挺多,开头要装一大堆东西。我比较追求完美,不需要的坚决不装,所以我采 取了如下编译过程: Ubuntu9.10默认安装的纯净系统,没装任何其他软件。 1.下载源码android-2.1_r2,直接make2.出错及解决如下:(1)/bin /bash: bison: command not found解决:a@ubuntu:~/work/android-2.1_r2$ sudo apt-get install bison (2)make: *** No rule to make target `Please-install-JDK-5.0,-updat 阅读全文
点击右上角即可分享
微信分享提示