0

I have 10 TextViews, their text and visibility is stored in an SQLite db. When an activity loads, I need to grab these values and apply them to the TextViews.

My db is currently structured as: _id, textviewID, text, visibility. What would be the best way to access these values and apply them to the correct TextView?

1 Answer 1

1

Take a look at this article, this post, and of course the Android Developer's topic on how to retirieve values from an sqlite db.

For these kind of configurations SharedPreferences are way more handy solution. If your design is not strict to use the local database for storing application preferences, you should consider it as an option.

Sign up to request clarification or add additional context in comments.

2 Comments

I had considered SharedPreferences. However, in the end I will have 20 views with 5 attributes each to store. And there will be multiples of this. So I could end up with 50 sets of 100 attributes. Is that too much for ShardPreferences?
I see, at that amount (not that there was a limit for SharedPreferences other than the storage size) it's probably best to use database, to keep the settings clear. The SharedPreferences object is stored in one xml, so it would get huge and hard to process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.