You have to instantiate your MySQLiteOpenHelper object (db) in the constructor. This is now:
private Context mContext; //Help I'm null
Cursor cursor;
history historyClass = new history();
MySQLiteHelper db = new MySQLiteHelper(mContext); //null is inserted here
public HistoryAdapter(Context context, Cursor cur){
super();
mContext = context;
cursor = cur;
}
This is how it should be:
private Context mContext; //Help I'm null
Cursor cursor;
history historyClass = new history();
MySQLiteHelper db;
public HistoryAdapter(Context context, Cursor cur){
super();
mContext = context;
cursor = cur;
db = new MySQLiteHelper(context); //not null anymore
}