I'm using the following statement to insert values in my table in SQLITE:
public void insertStocuri(Integer rucsaci,Integer kituri, Integer sticle)
{
ContentValues newValues = new ContentValues();
newValues.put("Rucsaci", rucsaci);
newValues.put("Kit",kituri);
newValues.put("Sticle",sticle);
Cursor query =db.query("STOCURI", null, null, null, null, null, null);
if(query.getCount()<1)
{
//db.replace("STOCURI", null, newValues);
db.insert("STOCURI", null, newValues);
///Toast.makeText(context, "Reminder Is Successfully Saved", Toast.LENGTH_LONG).show();
}
else {
db.update("STOCURI",newValues, null, null);
}
}
i've updated the question with the solution that works for me...