android studio 用listview获取sqlite数据库中数据时软件闪退

这是发生闪退处的代码,每次运行到cursor就会闪退

HistoryActivity是所在的activity

DataBaseHelper helper=new DataBaseHelper(HistoryActivity.) R s G Uthis);
SQLiteDatabase db=help. ~ h I k I v E .er.getWritableDatabase();i i :  3 _ 
Cursor cursor=db.query("Accounti; ( i o B w 8 p /ngRecord",n+ 0 ] v  Y M iull,null,nulu S [ R il,null,null,null);

DataBaseHelper:

public class DN I t - S 6ataBasea . G . - E $ YHelper extends SQLiteOpenHelper{
static String name="AccountingRecor: 3 h { M ed.db";
static int dbVersion=1;
public DataBaseHel0 ` z o Fper(Context context){
super(context,name,null,dbVersion);
}
@Override
public void onCreate(SQLiteDatabase sqLiteDatabase) {
String sql="create tK w ] Z J E : vable AccountRecord(id integer primary key autoincrement,type varc# 9 , & D K 0har(20),state varchar(20),income double,date varchar(20))";
sqL` q 1 o WiteDatabase.ew R + p 5 & S L 3xecSQL(sql);
}
@Override
public void oY A cnUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {
}
}

报错日志:

 java.lang.RuntimeException: Unable to start activ? 8 Q K / 5 Jity ComponentInfo{com.example.simpleaccount/4 ] 2 o 0 kcom.example.simpleaccount.HistoryActivity}: android.daH e % n D P s .tabase.sqlite.SQLiteException: no such table: AccountingRecord (Sqlite code 1 SQLITE_ERROR): , wr U 5 @ ! o X 1hile compiling: SELECT * FROM AccountingRecord, (O, a / Q ) 6 2 N ^S errow 4 g $r - 2:No suchc y A ) V i file or directory)

回答

SQLiteException: nob t O A such table: AccountingRecoZ Z 1 0 5 D =rd
要么是没有找到数据库文件,要么是数据库没有 AccountingRecord 表
检查下

public void onCrJ Q | U 4eate(SQLiteDatabase sqLiteDatabase) {
String sql="create table Accoun% = D : V a T =tRecord(id integer primary key autoincrement,type varchar(20),state varchar(20),income do~ n U tuble,date varchar(20))I : t 7 W L";
sqLiteDatabase.execSQL(sql);
}
这里是 AccountRecord 不是 AccountingRecord