2

So, I formulated my question in the header of topic. My task is the updating textview's of ListView.

Thanks a lot!

Eugene Shmorgun
  • 2,083
  • 12
  • 42
  • 67

2 Answers2

2

In order to add an item to the ListView you will need to add an item to the adapter that contains all the data, and call setAdapter() on the ListView again. If you need more specific help please post some of your code.

2

To update the list use list.notifyDataSetChanged();, and to add items just add them to your items list that you feed into the adapter

androidu
  • 4,678
  • 6
  • 36
  • 51
  • 1
    Can you hint me how to insert new item in certain position oа ListView?I'm trying to do as I updated the question - but I have inserted item at the botton of ListView. Sorry for stupid question - I found insert method in adapter/ – Eugene Shmorgun Feb 13 '12 at 16:16
  • you can use a second "buffer list" to hold your items, and using a for loop insert your items from your main list until the position where your new item should be inserted, then add your new item, then continue adding the rest of the items from your main list using position+1 item because of the extra item you added. BAM! there's your new list with the item added wherever you want – androidu Feb 13 '12 at 16:20