Hi

I'm having a bit of an issue with an app I'm making. The app retrieves tutorials from a specific website and allows users to store tutorials to an SQLite database for future use. However, once the tutorial has been added to the database, I'd like to disable my "Add to favourites" button. I've used the following code for this in the Activity that actually displays the tutorial:

Code:
if (mDbHelper.tutorialExists(articleTitle) == true) 
{
	favourites.setEnabled(false);
}
mDbHelper is a database adapter object. The following code is in the database adapter class:

Code:
public boolean tutorialExists(String tutorialTitle) {
		Cursor mCursor = mDb.query(true, DATABASE_TABLE, new String[] { KEY_ROWID }, 
				KEY_TITLE + " MATCH '" + tutorialTitle + "'", null, null, null, null, null);
		if (mCursor != null) { // If a tutorial exists in the database
			return true; // Get this tutorial
		}
		else {
			return false;
		}
	}
However, this is now setting the "Add to Favourites" button as disabled for all tutorials, even those not in the database.

If anyone could offer some advice, it would be much appreciated.

Thanks
Liam