摘要: 今天用android 制造数据,用webview控件把数据传递给js。结果js 解析json总是报错。找不到原因,很没头绪。先从数据上面排错。打印出数据,拷贝到vs中保存竟然报错,说有unicode编码无法保存。然后就开始用二分法一段段截取找问题字符。结果找到了是个空格,空格的编码有问题。用chor... 阅读全文
posted @ 2013-03-09 12:36 shenbin23 阅读(2699) 评论(0) 推荐(0) 编辑
摘要: 奶奶的,这个整了我好久。其实非常简单。1. C#的数据库链接字符串的末尾加上;CharSet=utf8;2. 数据库设计表默认字符集(defualt collation):utf8-general-ci3. 数据库引擎(engine)为:myisam4. C#页面看看是不是utf-8编码。这样中文进... 阅读全文
posted @ 2013-02-22 21:51 shenbin23 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 学习了一个下午的jsonp,记录一下以便以后翻阅。jsonp原理就是动态插入脚本,就是$.getscript的封装版。举例后台代码:private string funone(string para,string callback) { return callback+"({\... 阅读全文
posted @ 2013-02-20 21:17 shenbin23 阅读(268) 评论(0) 推荐(0) 编辑
摘要: 属性 -- > android --> is library选项勾上就可以做为android library project,让appliection project 共享属性 -- > android --> is library 下面addappliection library project ... 阅读全文
posted @ 2013-01-17 16:12 shenbin23 阅读(351) 评论(0) 推荐(0) 编辑
摘要: 1. 贪婪与惰性: .* 这样就是贪婪,.*? 加个问号就是惰性,只匹配到最近的。2. 分组 例如 String regPtnStr = "]*?>(.*?).*?id=\"humorContent_[\\d]*?\"class=\"pic_text\">(.*?)"; Pattern p=Pa... 阅读全文
posted @ 2013-01-17 11:59 shenbin23 阅读(137) 评论(0) 推荐(0) 编辑
摘要: android 自带的判断 null 空的 函数 阅读全文
posted @ 2012-11-30 17:49 shenbin23 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 今天在做listview setOnItemClickListener 事件,结果怎么都触发不了。整来大半天,没整好,网上的资料一般都是说button啊,checkbox啊,不要设置可点击。因为这些控件的获取焦点的权值会比listview的item的权值高,所以先被这些控件给捕获了,所以使得setO... 阅读全文
posted @ 2012-09-15 10:52 shenbin23 阅读(8026) 评论(0) 推荐(0) 编辑
摘要: 1. 自定义一个title.xml布局 2.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);setContentView(R.layout.main);getWindow().setFeatureInt(Window.... 阅读全文
posted @ 2012-09-12 14:03 shenbin23 阅读(1322) 评论(0) 推荐(0) 编辑
摘要: 如果你在by Log Tag 里配置了 System.out但程序执行时不能显示System.out.println("内容") 里面的内容请按以下步骤解决1、切换Eclipse视图至DDMS2、选择 windows----show view-----devices要开启设备,定位好应用程序,否则l... 阅读全文
posted @ 2012-09-02 14:39 shenbin23 阅读(2515) 评论(0) 推荐(0) 编辑
摘要: Caused by: android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag.... 阅读全文
posted @ 2012-08-29 16:34 shenbin23 阅读(1958) 评论(0) 推荐(0) 编辑