当password不等于storedPasswordthen然后mydb实例为null并且您正在尝试调用close()方法,因此NULL在调用close()之前进行检查onDestroy:
password
storedPassword
mydb
close()
NULL
onDestroy
@Override protected void onDestroy() { super.onDestroy(); if(null !=mydb) mydb.close(); //StartFlag = null; }