• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps should I use db or not

proskier

Newbie
So my app is very simple that I am building.

My main activity loads and xml file that is a bunch of tablerows and in my java I manipulate each of the row's background color(xml attribute) via this method


Code:
    public void colorRow(int id, int starCount){
        if (starCount == 0){
            TableRow row = (TableRow) findViewById(id);
            row.setBackgroundColor(Color.WHITE);
        }
        else if (starCount == 1){
            TableRow row = (TableRow) findViewById(id);
            row.setBackgroundColor(Color.YELLOW);
        }
        else if (starCount == 2){
            TableRow row = (TableRow) findViewById(id);
            row.setBackgroundColor(Color.CYAN);
        }
        else {
            TableRow row = (TableRow) findViewById(id);
            row.setBackgroundColor(Color.RED);
        }
    }

so prettymuch I want my rows to save when a user exits the app, so when they reopen it the color of the rows will be saved and show properly.

I was wondering if this would be wise to do with a db, preferences, savedInstanceState, or something else I dont know about.

Can someone please shed some light on how I should go about doing this? Thanks so much everyone.
 
Back
Top Bottom