1

How to open a database in a BroadcastReceiver

view story
linux-howto

http://stackoverflow.com – I have created a class to manage a SQLite database. Part of its code is as follows: public class Database extends SQLiteOpenHelper { private static final String DATABASE_NAME = "name"; private static final int DATABASE_VERSION = 1; public Database (Context ctx) { super(ctx, DATABASE_NAME, null, DATABASE_VERSION); } Then I have created another class, which is an SMS listener (extending BroadcastReceiver). Inside of this class I cannot create a database with the following command: db = new Database(this); because I get this error message: The constructor Database(SmsListener) is und (HowTos)