Android 数据库与MapView总结
2010-11-05 00:54:34 来源:WEB开发网核心提示:super(context, name, factory, version);TableNames = tableNames;FieldNames = fielsNames;FieldTypes = fieldTypes;// TODO Auto-generated constructor stub}@Override
super(context, name, factory, version);
TableNames = tableNames;
FieldNames = fielsNames;
FieldTypes = fieldTypes;
// TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
if (TableNames == null) {
message = NO_CREATE_TABLES;
return;
}
for (int i = 0; i < TableNames.length; i++) {
String sql = "create table " + TableNames[i] + " (";
for (int j = 0; j < FieldNames[i].length; j++) {
sql += FieldNames[i][j] + " " + FieldTypes[i][j] + ",";
}
sql = sql.substring(0, sql.length() - 1);
sql += ")";
db.execSQL(sql);
}
更多精彩
赞助商链接