摘要: 需求场景:当程序操作sd卡,比如在sd卡中存图,此时这张图在图库中无显示。解决方式:调用刷新媒体库代码。具体代码: Uri data = Uri.parse("file://" + WORKSPACE + strFileName + ".jpg"); sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, data));更新(2013-09-04): 媒体库更新全扫描代码: sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, U 阅读全文
posted @ 2012-09-25 14:44 Binary-Stream 阅读(1209) 评论(0) 推荐(0) 编辑
摘要: 转载:http://stackoverflow.com/questions/3845718/sql-how-to-update-table-values-from-another-table-with-the-same-user-name文章内容如下所示:sql: how to update table values from another table with the same user name?question: I have two tables, with a same column named user_name, saying table_a, table_b. I wa... 阅读全文
posted @ 2012-09-21 14:21 Binary-Stream 阅读(697) 评论(0) 推荐(0) 编辑
摘要: 需求: 有两个不同的SQLite数据库 A、B,需要将B数据库中的表复制到A数据库中去。解决办法: (1)使用软件:SQLite Expert Personal 3; (2)操作步骤: a) 在软件SQLite Expert Personal 3中打开 A、B数据库; b) 选择A数据库,点击鼠标右键,找到“Attach Database”选项,选择该项执行; c) 在弹出的“文件选择”界面中,选择B数据库文件,点击“确认”按钮; d) 在弹出的对话框中,先确认选择的数据库文件是否正确。如果正确,点击“OK”按钮; 此时,A、B两个数据库之间的关系已建立。 ... 阅读全文
posted @ 2012-09-17 15:38 Binary-Stream 阅读(9005) 评论(0) 推荐(0) 编辑
摘要: 1、SQLite一次性建立多表: db.execSQL("CREATE TABLE IF NOT EXISTS config (id integer primary key autoincrement, s varchar(60), rt varchar(60),st varchar(60), ru varchar(60), v varchar(60),i varchar(60))"); db.execSQL("CREATE TABLE IF NOT EXISTS application (id integer primary key autoincremen.. 阅读全文
posted @ 2012-09-05 11:48 Binary-Stream 阅读(5158) 评论(0) 推荐(0) 编辑
摘要: ExifInterface.ORIENTATION_UNDEFINED; //0 /**Top, left side (Horizontal / normal) */ ExifInterface.ORIENTATION_NORMAL; //1 /**Top, right side (Mirror horizontal) */ ExifInterface.ORIENTATION_FLIP_HORIZONTAL; //2 /**Bottom, right side (Rotate 180) */ ExifInterface.ORIEN... 阅读全文
posted @ 2012-08-23 14:21 Binary-Stream 阅读(1258) 评论(0) 推荐(0) 编辑
摘要: 问题场景:Object中的 Value不是自己预期值。具体描述: (1) 实例化一个HashMap类型的对象: HashMap<String, Object> hashMap = new HashMap<String, Object>();hashMap.put("string", "string");hashMap.put("intValue", 10); (2) 将该HashMap实例传递给别的类---classC:classC.set(hashMap); (3) 类classC将该对象继续传递给别的类cl 阅读全文
posted @ 2012-08-16 18:14 Binary-Stream 阅读(823) 评论(0) 推荐(0) 编辑
摘要: 首先,感谢该组件作者,:) 。组件下载地址:https://github.com/dinocore1/DevsmartLib-Android组件介绍地址:http://www.dev-smart.com/archives/34组件名称:HorizontalListView组件代码:如下所示/* * HorizontalListView.java v1.5 * * * The MIT License * Copyright (c) 2011 Paul Soucy (paul@dev-smart.com) * * Permission is hereby granted, free of ch.. 阅读全文
posted @ 2012-08-14 14:19 Binary-Stream 阅读(2039) 评论(0) 推荐(0) 编辑
摘要: 目标:扩大ImageButton的点击区域遭遇问题:在布局文件xml中定义了一个ImageButton,因为图标尺寸很小导致很难有效点击。 具体代码如下所示: <ImageButton android:id="@+id/imageButtonAlbum" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/bt_album" android:contentD 阅读全文
posted @ 2012-08-11 16:27 Binary-Stream 阅读(5891) 评论(0) 推荐(0) 编辑
摘要: 在做项目时,有这样一个需求:如果我的手机中安装了四个相机软件,那么,在调用系统相机的时候,这四个相机软件都会被列出来,但是其中的两个在拍照完后并不能将拍得的照片返回给我,因此,能不能指定开启一个我已知的能返回照片的相机App?整个解决过程如下:参考资料:http://my.oschina.net/armsky/blog/54692运行参考资料中所示代码时,遇到两个问题: (一)、“相机”App同一时间被打开两次;意即我需要按两次“返回”才能退出被打开的“相机”App。 (二)、用“相机”App拍完照后不能得到其返回值。事实上,如果用Intent intent = new Intent(Me.. 阅读全文
posted @ 2012-07-06 10:30 Binary-Stream 阅读(985) 评论(0) 推荐(0) 编辑
摘要: 资料来源:http://www.eoeandroid.com/thread-37271-1-1.html代码功能:调用系统自带的编辑联系人功能代码片段 // 如下用法在ANADOIR 2.3.6上面会报 “Caused by: android.database.sqlite.SQLiteException: no such column: raw_contact_id:” 异常 Intent intent = new Intent(Intent.ACTION_EDIT); intent.setData(Uri.parse("content://contacts/people/5... 阅读全文
posted @ 2012-05-08 11:12 Binary-Stream 阅读(907) 评论(1) 推荐(0) 编辑