我的代码是这样的
public Database(Context context) {
super(context, dbname, null, dbversion);
try{
db=getWritableDatabase();
// TODO Auto-generated constructor stub
if (db.isOpen()){
Toast.makeText(null, "Database is open", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(null, "Database is Closed", Toast.LENGTH_LONG).show();
}
} catch(Exception e) {
Log.e(dbname, e.getMessage());
}
}
我收到异常祝酒和日志猫节目
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.manager/com.example.manager.MainActivity}:
java.lang.NullPointerException: println needs a message