How to add and delete particular view based on position Dynamically in android? -


i implemeting sample application in android creating dynamic views.

please observe below image............

enter image description here

by seeing above picture want create dynamic view consists of close imageview, button, spinner , edittext clicking plus button. after entering fields click on plus button create new view above widgets similarly.

i want delete particular row clicking delete imageview. , again add clicking plus, repeat process untill how many rows want. click on submit button rows of views values , show details on next screen....

and tell me other way is, there possibility of create seperate xml file view , use on our code...

like see below picture...

enter image description here

please me.... in advance.....

if store views in iterable data structure list, iterate on them when "delete"-button klicked , search ones delete checking coordinates calling getx() , gety().

however, lfor said before, better way create own data structure each row. recommend create "row"-class containing views want add per row including "delete"-button , passing activity want add rows reference. doing can add components each row calling activity's method addcontentview() inside "row"-class. know views (all of "row"-object you're in) have remove, when delete button pressed.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -