How to create a layout dynamically using Json in android and get value from it ? Here is the Json -
{ layout:[ { tag :"edittext", name :"name", hint :"type name here" }, { tag :"checkbox", name :"is married", hint :"" }, { tag :"button", name :"submit", hint :"" } ] }
i describing want . first of above json change every time. structure same , tag, name , hint value change . above jsonarray has 3 jsonobject . might number(4/5/6 number of jsonobject) . can 1 plz suggest me how solve issue ?
its better divide question in small small parts, here have your
- parse json , fetch value : suggest follow how parse json in android link , have json.
check whether control edittext or button or else : suggest use switch case better coding structure
switch (tag ){ case "edittext": //add edittext break; case "button": //add button break; }
follow links add controls dynamically
generating edit text programatically in android
add button layout programmatically
how add checkboxes dynamically in android
Comments
Post a Comment