2

I have a ListView, the first 5 elements of which is to be populated by elements retrieved from an array defined in the strings.xml. These are static and will never change. The rest of the elements will be populated from the SQLite DB. These are dynamic and the user can remove from and add to these.

Is there a way I can implement a custom adapter where I can use a combination of ArrayAdapter and SimpleCursorAdapter.

I tried searching online for such a combination, but could not find anything that could help. Any help is appreciated.

rgamber
  • 5,749
  • 10
  • 55
  • 99
  • Why can't you try only ArrayAdapter by retrieving data from db to an array – Praveena Mar 20 '14 at 06:28
  • Make a common ArrayList combining ArrayAdapter data and SimpleCursorAdapter data and use a single ArrayAdapter – John Mar 20 '14 at 06:28
  • Create a new arraylist having values from your string.xml and from the database then pass that list into the listview adapter – jyomin Mar 20 '14 at 06:28
  • Yes @john and praveen. I can do that. But then I'll have to implement my own **Loader** to manage the dynamic data, which I want to avoid if possible. – rgamber Mar 20 '14 at 06:34
  • You might look into CommonsWare's [MergeAdapter](https://github.com/commonsguy/cwac-merge). – Mike M. Mar 20 '14 at 06:46

0 Answers0