http://developer.android.com/vis/android/database/sqlite/SQLiteOpenHelper.html#getWritableDatabase%28%29”rel=“nofollow” http://developer.android.com/vis/android/database/sqlite/SQLiteOpenHelper.html#getWritableDatabase%28%29。
Once opened successfully, the database is cached, so you can call this method every time you need to write to the database.
考虑如下文 the:
SQLiteDatabase db1 = openHelperImplObj.getWritableDatabase();
// do something with db1
SQLiteDatabase db2 = openHelperImplObj.getWritableDatabase();
// do something with db2
db2.close();
// do something with db1
db1.close();
我先谈一下获取可检索数据库的第二次呼吁:将退回同一附则的行文(db1),该呼吁是否将分线db2.close()引起任何问题,以取代后来出现的1项行动? 如果是的话,建议如何避免这一问题,因为第二次呼吁可能发生在任何地方,即不同职能,甚至不同类别。