db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_NAME, "John"); db.insert(TABLE_CONTACTS, null, values); db.close();
try{ //save data here } catch (Exception e) { e.printStackTrace(); }
public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); }
private static final int DATABASE_VERSION = 1;
如果您使用以上方法仍无法解决问题,请确保您已经对该问题进行了足够的调查,并考虑寻求更高级别的支持。