Displaying conditional amount of fields in UI (Android)

Posted by Sochin on Stack Overflow See other posts from Stack Overflow or by Sochin
Published on 2010-05-31T21:31:40Z Indexed on 2010/05/31 21:33 UTC
Read the original article Hit count: 154

Filed under:
|

I am using layout xml documents for my ui controls.

I need to create and remove these controls (input fields) on the fly, based on how many results I get back from my database.

For each group, there can be 0..* fields and these are prepopulated from the database.

Also, it would be good if I can invoke a method to create an additional field; something like the address book, where you can click + or - to add or remove a phone or other detail.

In a "psuedo" style, I'm guessing something like this:

  1. Check database - How many of X are there [y]?
  2. Create Y fields.

The user may then add new fields, so once I click submit i need to apply all of that to database.

Any examples or hints greatly welcomed. Hope this make sense! :)

© Stack Overflow or respective owner

Related posts about android

Related posts about gui