this is my android code that show me number of records in MainContent table. but when I test it my record inserted
String C1 = "SELECT count(*) FROM `MainContent` WHERE `GroupID` LIKE '"+strI+"'";
Cursor MC1 = mydatabase1.rawQuery(C1, null);
MC1.moveToFirst();
int CountG1 = MC1.getInt(0);
if(CountG1 > 4)
{
mydatabase1.execSQL("INSERT INTO MainContent (AppName,Txt,GroupID,Time) VALUES('" + appName + "','" + txtClip + "','" + strI + "','" + text_Date + "');");
mydatabase1.execSQL("DELETE FROM Details WHERE ID = " + SaveID + ";");
mydatabase1.close();
}
else
{
Toast.makeText(getApplicationContext(),"Trial Version",Toast.LENGTH_SHORT).show();
}
Aucun commentaire:
Enregistrer un commentaire