I am in the process of developing a general mobile application frame work in which before displaying each form element, the application will check whether the element has dependency with any of the previous controls.

For example, Say I have the following form elements Name, Gender, Age Group (If male, display age group), hobbies etc.
After appending the Gender and before appending the age group in the forms, my app performs the following operation in the itemstate change of Gender
1. Clear all form item below Gender
2. Check dependency
3. If true, add form item
4. If false, go to next item

This algorithm causes flickering in my mobile since each time when I add/edit the form value it needs refresh the entire form that can have around 15-20 form elements. It causes poor performance also.

Can anyone suggest some other way to avoid this flickering