android application and list like a db

  • Replies:1
  • OpenNot stickiedUnanswered

Jun 11, 2012 12:17:43 PM

hello.
I have a list of custom controls(a button and an image in an inherited table layout) created from the db.
in the db there is a product table with the path of the image and the text of the button , more a list of charateristics like price , color ecc..
In the custom controls there are also a selected/unselected flag , plus an public IsSelelected method.
I must understand the area where the data and the visualization must going.
I use a activity with a grid layout for the visualization of the custom controls, an adapter for populate the activity controls and a class inherited from table layout for the custom control.
I can select a custom control by clicking on his button, but now i wish create in the activity a button that visualize all the selected controls and a button that visualizes only the don't selected controls.


1)I must redo the bind of adapter on the activity?
and put in the layout only the selected controls calling the isSelected method?

2)where i can place the controls creation from db the first time(i repeat , i have a product table on db) , i think in a custom control list with all the controls and , from that list i can extract a selected / unselected list of controls for the adapter.
But how i can create and where a wrapper around this list for extracting of only selected , only unselected ecc...?

i think to do like for the operations on the db:
with the url, and a wrapper with a proxy around the List of all custom controls.
for ex:
url:"products/list" return a list with all the controls
url:"products/selected" return a list with all the selected controls
url:"products/unselected" return a list with all the unselected controls
url:"products/1" return the custom control with id == 1
then i rebind the adapter with this eextracted list
but how?in what class?
is the same of the db , but with a List instead a db table
thanks.