android - Remember ListView selection using SQL - AFTER closing the App -


having thoroughly serched before, not find question me.

my issue having listview, automatically gets populated sql-database upon opening app. now, user can make selection 1 item in list. selection treated public void onitemclick() in order increase usability, i'd have selection remembered after closing , re-opening app.

i've tried everything.. hope can me idea.

create column in data base called checked,

(create table ..... checked int...) 

when user checks listitem in

onlistitemclick {     sqlitedatabase db = getdb();     //set unchecked     db.exec("update ..table.. set checked = 0");     //set choice checked     db.exec(update ...table... set checked=1 id = "+cellid+"); } 

then on start in list adapter value of checked out of database , update ui accordingly.

i have used pattern in several apps , work well.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -