3

enter image description here

Hi,

I want to implement form like in the image, dont have idea how they are adding Fields dynamically. Is this a ListView? Expandable List? user can add and remove at runtime. I have checked Expandable List which contains child items. but we define child in array, In the image they add dynamically.

Any guide/link

Thanks

1 Answer 1

1

Custom ListView Adapters are often back by Collections, like List, ArrayList, etc. These lists may contain your custom objects, where the Adapter determines what to display based on the object properties. The lists can be managed/altered in typical fashions, like add() remove(), etc.

Do a Google search for "android custom list adapters" to learn more.

Here is an example of dynamically creating list rows with a "plus" buttons to add more rows. Should give you a good start: Dynamically add elements to a listView Android

You can always look at the source of the Android contacts app, as well.

Sign up to request clarification or add additional context in comments.

3 Comments

Hi, I have tried different tutorials, but problem is how to add and remove content in the place of Item at runtime.
Like in the image, Email Group has add and remove button.
Did you check the link I added above? It appears that you need to brush up on Java, first. This method dynamically adds list items public void addItems(View v) { listItems.add("Clicked : "+clickCounter++); adapter.notifyDataSetChanged(); }. Removing would simple be something like listItems.remove(index); adapter.notifyDataSetChanged();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.