Hi, All: I have a problem when using database in broadcastReceiver. I can't open the database created in the activity. e.g: malwareDB = new PackageDB(this); The eclipse give me the error that "PackageDB(this)" is undefined. It seems that the BroadcastReceiver doesn't support the database? Do have have to access the data base in the "service"?
Here is the definition of "PackageDB": public class PackageDB extends SQLiteOpenHelper { ... public PackageDB(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } public void onCreate(SQLiteDatabase db) { String sql = "CREATE TABLE " + TABLE_NAME + " (" + FIELD_id + " INTEGER primary key autoincrement, " + " " + FIELD_TEXT + " text)"; db.execSQL(sql); } ... } With many thanks. BR, Feng. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en