I want to keep only five records in my SQLite database 开发者_JAVA百科if a new value is stored means i want to delete the last record in android application .Please any one help me how to do this
Thanks in advance
You need to write the method of get the count(number of records in sqlite DB), & check if count is 5 then before inserting record into DB you can delete the existing row which you want to remove.( For this also you need to write the method which accepts the some unique key so that you can delete that row only.)
精彩评论