Advertisement
ali50mahmoud

database.execSQL("INSERT INTO custom_timer_session VALUES

Mar 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. String createTable= "CREATE TABLE " + TABLE_Name+"("
  2. + KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + KEY_NAME + " TEXT,"
  3. + ")";
  4. db.execSQL(createTable);
  5. ///////////////////
  6.  
  7.  
  8. database.execSQL("INSERT INTO custom_timer_session VALUES(1,'Tabata','tota')");
  9. database.execSQL("INSERT INTO custom_timer VALUES(1,'WORK','salwa')");
  10. database.execSQL("INSERT INTO custom_timer VALUES(2,'REST','gain')");
  11.  
  12.  
  13.  
  14. private void createNote(String note) {
  15. // inserting note in db and getting
  16. // newly inserted note id
  17. long id = db.insertNote(note);
  18.  
  19. // get the newly inserted note from db
  20. Note n = db.getNote(id);
  21.  
  22. if (n != null) {
  23. // adding new note to array list at 0 position
  24. notesList.add(0, n);
  25.  
  26. // refreshing the list
  27. mAdapter.notifyDataSetChanged();
  28.  
  29. toggleEmptyNotes();
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement