ITeye博客

android中易错点

decentway · 2012-01-03 10:58 · android · 移动开发 · Markdown

1.字符串匹配:

equals和==是有区别的

用jsoup的select获得text,比如"我、你",好像和字符串的"我、你",用equals不能相等,我也不知道为什么,只有把字符串里面的符号去掉才行。

2,执行sqlite数据库操作:

"create table"+ TBL_NAME
   +"(classname varchar(40),time integer , week integer)"

在引号外面的空格都不算空格。加入TBL_NAME是xx的话那么这句话就是:create tablexx

所有要在table后面引号前面加空格"create table  "+ TBL_NAME

3.Failure 21 (out of memory) on 0x0 when preparing 'PRAGMA user_version = 1'.

这个错误时看一篇英文文章解决的:

http://stackoverflow.com/questions/5208606/cannot-create-android-sqlite-database-pragma-error

因为android在db.execSQL(CREATE_TBL);之后,系统自动close了数据库,所以不要手动关闭。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。