I am getting the following error from my code
'Cannot make a static reference to the non-static method getReadableDatabase() from the type SQLiteOpenHelper'
in the Database.java
file. If I use Eclipse to solve the error then an error happens in the FavouriteScreen.java
file. Anyone know how to solve it?
FavouritesScreen.java
// Get a Cursor for the list items
Cursor listCursor = Database.GetFavouritesList();
startManagingCursor(listCursor);
// set the custom list adapter
setListAdapter(new MyListAdapter(this, listCursor));
and
Database.java
public static Cursor GetFavouritesList(){
try
{
return(getReadableDatabase().rawQuery("SELECT SocietyName FROM Favourites",null));
}
catch(SQLiteException e)
{
Log.e("Favourites", e.toString());
}
return null;
}