我正在尝试关闭数据库,但它给了我错误。
private SQLiteDatabase sq;
//cardDatabase name of my class.
public void close_DB(){
CardDatabase data_open=new CardDatabase(MyContext);
sq.close();
data_open.close_DB();
}
03-02 09:13:03.841: D/java.lang.NullPointerException(2447): java.lang.NullPointerException 03-02 09:13:03.841: D/java.lang.NullPointerException(2447): java.lang.NullPointerException 03-02 09:13:03.841: D/java.lang.NullPointerException(2447): 在 com.livecards.beta.CardDatabase.close_DB(CardDatabase.java:52)