Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean insetTheme(String name2,String Description){
- SQLiteDatabase Mydb =this.getWritableDatabase();
- ContentValues newThingAdd = new ContentValues();
- newThingAdd.put(COL2_ALLTHEMES,name2);
- newThingAdd.put(COL3_ALLTHEMES,Description);
- long result = Mydb.insertOrThrow(TABLE_ALLTHEMES,null,newThingAdd);
- Cursor res = Mydb.rawQuery("select * from "+TABLE_ALLTHEMES + " where 'ID2'" ,null);
- //res.moveToLast();
- if (res != null) {
- res.move(-1);
- }
- ContentValues newThingAdd123 = new ContentValues();
- newThingAdd123.put(COL2_CURRENTTHEMES,name2);
- newThingAdd123.put(COL3_CURRENTTHEMES,Description);
- newThingAdd123.put("ID3",res.toString());
- long result2 = Mydb.insertOrThrow(TABLE_CURRENTTHEMES,null,newThingAdd123);
- if ((result==-1)&(result2==-1))
- return false;
- else
- return true;
- }
Add Comment
Please, Sign In to add comment