---
title: "android中易错点"
author: "decentway"
date: "2012-01-03T10:58:30Z"
tags: []
categories: ["移动开发"]
slug: "android"
draft: false
lastmod: "2012-01-07T01:53:01Z"
id: 1333405
url: "https://decentway.iteye.com/blog/1333405"
---

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](http://stackoverflow.com/questions/5208606/cannot-create-android-sqlite-database-pragma-error)

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