开发者

How to get SQLite database value to android app?

开发者 https://www.devze.com 2023-03-16 16:58 出处:网络
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

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.)

0

精彩评论

暂无评论...
验证码 换一张
取 消