Can I have one itemStateChanged method to monitor changes triggered by user for many Displayable objects in a MIDlet (e.g. for a form and a list), using if clauses to decide what was changed, or do I have to create a different method for each Displayable I want to monitor?
Asked
Active
Viewed 384 times
1 Answers
2
If you are talking about instantiating several Form and one ItemStateListener and calling Form.setItemStateListener() several times with the same parameter, then yes, you can do that.
Theoretically, you should write thread-safe code in your implementation of itemStateChanged but given the way existing java-me implementations handle events and the very small number of MIDP-compliant phones using 2 physical screens, I don't think it's very important in practice.

michael aubert
- 6,836
- 1
- 16
- 32