Project Description:
I have a QR List Adapter where I add values (qr code and youtube id) to database:
public void add(String qrcode, String ytid){
ContentValues values = new ContentValues();
[login to view URL]([login to view URL], qrcode);
[login to view URL](DatabaseHelper.YT_ID, ytid);
[login to view URL]().insert(YouListContentProvider.CONTENT_URI, values);
QRItem item = new QRItem([login to view URL], qrcode, ytid);
[login to view URL]().add(item);
notifyDataSetChanged();
}
I want to be able to search the database beforehand and if the values (QRCODE and youtube ID) already exists (the video is already in the database) then not to add them to the list. My database helper looks like this:
@Override
public void onCreate(SQLiteDatabase db) {
[login to view URL]("CREATE TABLE " + TABLE_NAME + "("
+ID+" INTEGER PRIMARY KEY, "
+QRCODE+" TEXT, "
+YT_ID+" TEXT )");
PutValues(db);
}
It's a small project and I would like it to be done asap.