This is more of a question about getting my head around the process I need to follow really.
I short:
- I need to read the exisiting table (a rugby squad) and display it on screen.
- The user has the option of tapping any entry and updating it – and repeating as necessary.
- The user can then tap “Accept” or “Cancel”
- If “Accept” is tapped I obviously want to update the table with the new values.
The squad can be from 10 to 22 players, so I need the display to be fairly dynamic and ideally I need a shirt number (static), a name (text, updateable) and a “starting” checkbox (updateable)
I’ve kind of got my head around each on the indiviual components, but when I try and tie them together it all goes pear-shaped!
Can anyone point me in the right direction, please?
It sounds to me like a simple datbabase backing a ListView would be the way to go. That way you can offer different options for sorting the list, etc.
EDIT
In your main xml have the listview and two buttons at the bottom (accept and cancel).
Create a Listview rowlayout.xml that contains a textview, an edittext and a checkbox.
Populate them like normal (you can use
setText()on an EditText just like a TextView). Put the shirt number in the textview and the player name in the edittext and the starting state to set the checkbox.Then you simply wire up the accept button to cycle through the list and commit any changes you made and the cancel button to reset them all to the last saved values.