I created two tables:
Both tables have two entries when I added a third entry to the Item.db table and copy this entry to TempItem.db, this time duplicating the entry added to my TempItem table.
How to prevent this?
My source code
for(int ip=0; ip<results.size(); ip++)
{
for(int ig=0; ig<resultmain.size(); ig++)
{
if((results.get(ip).item).equals(resultmain.get(ig).item))
{
Toast.makeText(getApplicationContext(), "no", 100).show();
}
else
{
mb.insertEntry(1, 1, 1, 1, "Baby", "1", "100", "100");
}
}
}
But each time a duplicate value is added.
source
share